org.apache.lucene.analysis

## Class TokenFilter

- java.lang.Object
- - org.apache.lucene.util.AttributeSource
  - - org.apache.lucene.analysis.TokenStream
    - - org.apache.lucene.analysis.TokenFilter

- Direct Known Subclasses:
    ArabicNormalizationFilter, ArabicStemFilter, ASCIIFoldingFilter, BrazilianStemFilter, CachingTokenFilter, ChineseFilter, CollationKeyFilter, CompoundWordTokenFilterBase, DelimitedPayloadTokenFilter, DutchStemFilter, EdgeNGramTokenFilter, ElisionFilter, FrenchStemFilter, GermanStemFilter, GreekLowerCaseFilter, ICUCollationKeyFilter, ISOLatin1AccentFilter, LengthFilter, LowerCaseFilter, NGramTokenFilter, NumericPayloadTokenFilter, PersianNormalizationFilter, PorterStemFilter, PositionFilter, ReverseStringFilter, RussianLowerCaseFilter, RussianStemFilter, ShingleFilter, SnowballFilter, StandardFilter, StopFilter, SynonymTokenFilter, TeeSinkTokenFilter, TeeTokenFilter, ThaiWordFilter, TokenOffsetPayloadTokenFilter, TypeAsPayloadTokenFilter, WordTokenFilter

      public abstract class TokenFilter
      extends TokenStream

  A TokenFilter is a TokenStream whose input is another TokenStream.

  This is an abstract class; subclasses must override `TokenStream.incrementToken()`.

  See Also:
    `TokenStream`

- - ### Nested Class Summary

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

      `AttributeSource.AttributeFactory, AttributeSource.State`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected TokenStream` | `input` The source of tokens for this filter.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `TokenFilter(TokenStream input)` Construct a token stream filtering the given input.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close the input TokenStream.
    `void` | `end()` Performs end-of-stream operations, if any, and calls then `end()` on the input TokenStream. NOTE: Be sure to call `super.end()` first when overriding this method.
    `void` | `reset()` Reset the filter as well as the input TokenStream.

    - ### Methods inherited from class org.apache.lucene.analysis.TokenStream

      `getOnlyUseNewAPI, incrementToken, next, next, setOnlyUseNewAPI`

    - ### Methods inherited from class org.apache.lucene.util.AttributeSource

      `addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, restoreState, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### input

          protected final TokenStream input

      The source of tokens for this filter.

  - ### Constructor Detail

    - #### TokenFilter

          protected TokenFilter(TokenStream input)

      Construct a token stream filtering the given input.

  - ### Method Detail

    - #### end

          public void end()
                   throws java.io.IOException

      Performs end-of-stream operations, if any, and calls then `end()` on the input TokenStream.

      NOTE: Be sure to call `super.end()` first when overriding this method.
      Overrides:
        `end` in class `TokenStream`
      Throws:
        `java.io.IOException`

    - #### close

          public void close()
                     throws java.io.IOException

      Close the input TokenStream.
      Overrides:
        `close` in class `TokenStream`
      Throws:
        `java.io.IOException`

    - #### reset

          public void reset()
                     throws java.io.IOException

      Reset the filter as well as the input TokenStream.
      Overrides:
        `reset` in class `TokenStream`
      Throws:
        `java.io.IOException`

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