Class AbstractTokenizingFilter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, org.apache.lucene.util.Unwrappable<org.apache.lucene.analysis.TokenStream>
    Direct Known Subclasses:
    AlphaNumericFilter, UrlTokenizingFilter

    @NotThreadSafe
    public abstract class AbstractTokenizingFilter
    extends org.apache.lucene.analysis.TokenFilter
    An abstract tokenizing filter that can be used as the base for a tokenizing filter.
    Author:
    Jeremy Long
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.lucene.util.AttributeSource

        org.apache.lucene.util.AttributeSource.State
    • Field Summary

      • Fields inherited from class org.apache.lucene.analysis.TokenFilter

        input
      • Fields inherited from class org.apache.lucene.analysis.TokenStream

        DEFAULT_TOKEN_ATTRIBUTE_FACTORY
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractTokenizingFilter​(org.apache.lucene.analysis.TokenStream stream)
      Constructs a new AbstractTokenizingFilter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean addTerm()
      Adds a term, if one exists, from the tokens collection.
      protected org.apache.lucene.analysis.tokenattributes.CharTermAttribute getTermAtt()
      Gets the CharTermAttribute.
      protected java.util.ArrayDeque<java.lang.String> getTokens()
      Gets the list of tokens.
      void reset()
      • Methods inherited from class org.apache.lucene.analysis.TokenFilter

        close, end, unwrap
      • Methods inherited from class org.apache.lucene.analysis.TokenStream

        incrementToken
      • Methods inherited from class org.apache.lucene.util.AttributeSource

        addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, endAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, removeAllAttributes, restoreState, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AbstractTokenizingFilter

        public AbstractTokenizingFilter​(org.apache.lucene.analysis.TokenStream stream)
        Constructs a new AbstractTokenizingFilter.
        Parameters:
        stream - the TokenStream that this filter will process
    • Method Detail

      • getTermAtt

        protected org.apache.lucene.analysis.tokenattributes.CharTermAttribute getTermAtt()
        Gets the CharTermAttribute.
        Returns:
        the CharTermAttribute
      • getTokens

        protected java.util.ArrayDeque<java.lang.String> getTokens()
        Gets the list of tokens.
        Returns:
        the list of tokens
      • reset

        public void reset()
                   throws java.io.IOException
        Overrides:
        reset in class org.apache.lucene.analysis.TokenFilter
        Throws:
        java.io.IOException
      • addTerm

        protected boolean addTerm()
        Adds a term, if one exists, from the tokens collection.
        Returns:
        whether or not a new term was added