public abstract class FilteringTokenFilter extends TokenFilter
accept()
and return a boolean if the current
token should be preserved. incrementToken()
uses this method
to decide if a token should be passed to the caller.AttributeSource.State
input
DEFAULT_TOKEN_ATTRIBUTE_FACTORY
Constructor and Description |
---|
FilteringTokenFilter(TokenStream in)
Create a new
FilteringTokenFilter . |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
accept()
Override this method and return if the current input token should be returned by
incrementToken() . |
void |
end() |
boolean |
incrementToken() |
void |
reset() |
close
addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState, toString
public FilteringTokenFilter(TokenStream in)
FilteringTokenFilter
.in
- the TokenStream
to consumeprotected abstract boolean accept() throws IOException
incrementToken()
.IOException
public final boolean incrementToken() throws IOException
incrementToken
in class TokenStream
IOException
public void reset() throws IOException
reset
in class TokenFilter
IOException
public void end() throws IOException
end
in class TokenFilter
IOException
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.