public class DateRecognizerSinkFilter extends TeeSinkTokenFilter.SinkFilter
CharTermAttributeImpl.termBuffer()
as a Date using a DateFormat
.
If the value is a Date, it will add it to the sink.
Modifier and Type | Field and Description |
---|---|
static String |
DATE_TYPE |
protected DateFormat |
dateFormat |
protected CharTermAttribute |
termAtt |
Constructor and Description |
---|
DateRecognizerSinkFilter()
Uses
DateFormat.getDateInstance() as the DateFormat object. |
DateRecognizerSinkFilter(DateFormat dateFormat) |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(AttributeSource source)
Returns true, iff the current state of the passed-in
AttributeSource shall be stored
in the sink. |
reset
public static final String DATE_TYPE
protected DateFormat dateFormat
protected CharTermAttribute termAtt
public DateRecognizerSinkFilter()
DateFormat.getDateInstance()
as the DateFormat
object.public DateRecognizerSinkFilter(DateFormat dateFormat)
public boolean accept(AttributeSource source)
TeeSinkTokenFilter.SinkFilter
AttributeSource
shall be stored
in the sink.accept
in class TeeSinkTokenFilter.SinkFilter