Package eu.bandm.tools.lexic
Class LookaheadTokenProcessor<D,T,L>
java.lang.Object
eu.bandm.tools.lexic.LookaheadTokenProcessor<D,T,L>
- Type Parameters:
D
- the type of source document identifiersT
- the type of token typesL
- the type of lookahead data
- All Implemented Interfaces:
LookaheadTokenSource<D,
,T, L> Supplier<Token<D,
T>>
- Direct Known Subclasses:
LookaheadTokenFilter
,Screener
,TokenProcessor
public abstract class LookaheadTokenProcessor<D,T,L>
extends Object
implements LookaheadTokenSource<D,T,L>
Abstract base class for secondary token sources that feed on other
token sources.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final LookaheadTokenSource<D,
T, L> The input token source. -
Constructor Summary
ModifierConstructorDescriptionprotected
LookaheadTokenProcessor
(LookaheadTokenSource<D, T, L> input) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionClear the internal lookahead buffer and return its contents.void
takeOverLookahead
(L lookaheadData) Fill the internal lookahead buffer with data.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.bandm.tools.lexic.LookaheadTokenSource
forgetLookahead, removeTypes, removeTypes
-
Field Details
-
input
The input token source.
-
-
Constructor Details
-
LookaheadTokenProcessor
Creates a new instance.- Parameters:
input
- the input token source
-
-
Method Details
-
relinquishLookahead
Description copied from interface:LookaheadTokenSource
Clear the internal lookahead buffer and return its contents.- Specified by:
relinquishLookahead
in interfaceLookaheadTokenSource<D,
T, L> - Returns:
- the former contents of the internal lookahead buffer
-
takeOverLookahead
Description copied from interface:LookaheadTokenSource
Fill the internal lookahead buffer with data.The buffer must be empty before this method is invoked. After return, the given data will be consumed from the buffer before the usual input is considered.
- Specified by:
takeOverLookahead
in interfaceLookaheadTokenSource<D,
T, L> - Parameters:
lookaheadData
- the lookahead data to fill in
-