public class DateRecognizerSinkFilter extends TeeSinkTokenFilter.SinkFilter
CharTermAttribute.buffer()
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(DateFormat.DEFAULT, Locale.ROOT) 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(DateFormat.DEFAULT, Locale.ROOT)
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
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.