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> Closeable,AutoCloseable,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
FieldsModifier and TypeFieldDescriptionprotected final LookaheadTokenSource<D, T, L> The input token source. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLookaheadTokenProcessor(LookaheadTokenSource<D, T, L> input) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this source and releases any resources associated with it.Clear the internal lookahead buffer and return its contents.voidtakeOverLookahead(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, waitMethods 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:LookaheadTokenSourceClear the internal lookahead buffer and return its contents.- Specified by:
relinquishLookaheadin interfaceLookaheadTokenSource<D,T, L> - Returns:
- the former contents of the internal lookahead buffer
-
takeOverLookahead
Description copied from interface:LookaheadTokenSourceFill 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:
takeOverLookaheadin interfaceLookaheadTokenSource<D,T, L> - Parameters:
lookaheadData- the lookahead data to fill in
-
close
public void close()Closes this source and releases any resources associated with it.The default implementation does nothing.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceLookaheadTokenSource<D,T, L>
-