## org.apache.lucene.facet.index.streaming
Class CountingListTokenizer

    java.lang.Object
      org.apache.lucene.util.AttributeSource
          org.apache.lucene.analysis.TokenStream
              org.apache.lucene.analysis.TokenFilter
                  org.apache.lucene.facet.index.streaming.CategoryTokenizerBase
                      org.apache.lucene.facet.index.streaming.CategoryListTokenizer
                          org.apache.lucene.facet.index.streaming.CountingListTokenizer

All Implemented Interfaces:
  Closeable

    public class CountingListTokenizer

extends CategoryListTokenizer

`CategoryListTokenizer` for facet counting

WARNING: This API is experimental and might change in incompatible ways in the next release.

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.lucene.util.AttributeSource
`org.apache.lucene.util.AttributeSource.AttributeFactory, org.apache.lucene.util.AttributeSource.State`

Field Summary
`protected Iterator<Map.Entry<String,CategoryListPayloadStream>>` `payloadStreamIterator` An iterator over the payload streams
`protected HashMap<String,CategoryListPayloadStream>` `payloadStreamsByName` A table for retrieving payload streams by category-list name.

Fields inherited from class org.apache.lucene.facet.index.streaming.CategoryTokenizerBase
`categoryAttribute, indexingParams, payload, payloadAttribute, termAttribute`

Fields inherited from class org.apache.lucene.analysis.TokenFilter
`input`

Constructor Summary
`CountingListTokenizer(org.apache.lucene.analysis.TokenStream input, FacetIndexingParams indexingParams)`

Method Summary
`protected CategoryListPayloadStream` `getPayloadStream(CategoryPath categoryPath, int ordinal)`
`protected void` `handleStartOfInput()` A method invoked once when the input stream begins, for subclass-specific processing.
`boolean` `incrementToken()`
`protected boolean` `legalCategory()` A method which allows extending classes to filter the categories going into the counting list.

Methods inherited from class org.apache.lucene.facet.index.streaming.CategoryListTokenizer
`handleEndOfInput, reset`

Methods inherited from class org.apache.lucene.analysis.TokenFilter
`close, end`

Methods inherited from class org.apache.lucene.util.AttributeSource
`addAttribute, addAttributeImpl, captureState, clearAttributes, cloneAttributes, copyTo, equals, getAttribute, getAttributeClassesIterator, getAttributeFactory, getAttributeImplsIterator, hasAttribute, hasAttributes, hashCode, reflectAsString, reflectWith, restoreState, toString`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### payloadStreamsByName

    protected HashMap<String,CategoryListPayloadStream> payloadStreamsByName

  A table for retrieving payload streams by category-list name.

### payloadStreamIterator

    protected Iterator<Map.Entry<String,CategoryListPayloadStream>> payloadStreamIterator

  An iterator over the payload streams

Constructor Detail

### CountingListTokenizer

    public CountingListTokenizer(org.apache.lucene.analysis.TokenStream input,
                                 FacetIndexingParams indexingParams)

Method Detail

### handleStartOfInput

    protected void handleStartOfInput()
                               throws IOException

  Description copied from class: `CategoryListTokenizer`
  A method invoked once when the input stream begins, for subclass-specific processing. Subclass implementations must invoke this one, too!

  Overrides:
    `handleStartOfInput` in class `CategoryListTokenizer`
  Throws:
    `IOException`

### incrementToken

    public final boolean incrementToken()
                                 throws IOException

  Specified by:
    `incrementToken` in class `CategoryListTokenizer`
  Throws:
    `IOException`

### legalCategory

    protected boolean legalCategory()

  A method which allows extending classes to filter the categories going into the counting list.

  Returns:
    By default returns `true`, meaning the current category is to be part of the counting list. For categories that should be filtered, return `false`.

### getPayloadStream

    protected CategoryListPayloadStream getPayloadStream(CategoryPath categoryPath,
                                                         int ordinal)
                                                  throws IOException

  Throws:
    `IOException`