org.apache.lucene.analysis.sinks
Class DateRecognizerSinkFilter

java.lang.Object
  extended by org.apache.lucene.analysis.sinks.TeeSinkTokenFilter.SinkFilter
      extended by org.apache.lucene.analysis.sinks.DateRecognizerSinkFilter

public class DateRecognizerSinkFilter
extends TeeSinkTokenFilter.SinkFilter

Attempts to parse the CharTermAttribute.buffer() as a Date using a DateFormat. If the value is a Date, it will add it to the sink.


Field Summary
static String DATE_TYPE
           
protected  DateFormat dateFormat
           
protected  CharTermAttribute termAtt
           
 
Constructor Summary
DateRecognizerSinkFilter()
          Uses DateFormat#getDateInstance(DateFormat.DEFAULT, Locale.ROOT) as the DateFormat object.
DateRecognizerSinkFilter(DateFormat dateFormat)
           
 
Method Summary
 boolean accept(AttributeSource source)
          Returns true, iff the current state of the passed-in AttributeSource shall be stored in the sink.
 
Methods inherited from class org.apache.lucene.analysis.sinks.TeeSinkTokenFilter.SinkFilter
reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATE_TYPE

public static final String DATE_TYPE
See Also:
Constant Field Values

dateFormat

protected DateFormat dateFormat

termAtt

protected CharTermAttribute termAtt
Constructor Detail

DateRecognizerSinkFilter

public DateRecognizerSinkFilter()
Uses DateFormat#getDateInstance(DateFormat.DEFAULT, Locale.ROOT) as the DateFormat object.


DateRecognizerSinkFilter

public DateRecognizerSinkFilter(DateFormat dateFormat)
Method Detail

accept

public boolean accept(AttributeSource source)
Description copied from class: TeeSinkTokenFilter.SinkFilter
Returns true, iff the current state of the passed-in AttributeSource shall be stored in the sink.

Specified by:
accept in class TeeSinkTokenFilter.SinkFilter


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.