org.apache.lucene.index

## Class BaseTermVectorsFormatTestCase.RandomTokenStream

- java.lang.Object
- - org.apache.lucene.util.AttributeSource
  - - org.apache.lucene.analysis.TokenStream
    - - org.apache.lucene.index.BaseTermVectorsFormatTestCase.RandomTokenStream

- All Implemented Interfaces:
    Closeable, AutoCloseable
  Enclosing class:
    BaseTermVectorsFormatTestCase

      public static class BaseTermVectorsFormatTestCase.RandomTokenStream
      extends TokenStream

  Produces a random TokenStream based off of provided terms.

- - ### Nested Class Summary

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

      `AttributeSource.State`

  - ### Field Summary

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

      `DEFAULT_TOKEN_ATTRIBUTE_FACTORY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RandomTokenStream(int len, String[] sampleTerms, BytesRef[] sampleTermBytes)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int[]` | `getEndOffsets()`
    `BytesRef[]` | `getPayloads()`
    `int[]` | `getPositionsIncrements()`
    `int[]` | `getStartOffsets()`
    `BytesRef[]` | `getTermBytes()`
    `String[]` | `getTerms()`
    `boolean` | `hasPayloads()`
    `boolean` | `incrementToken()`
    `protected BytesRef` | `randomPayload()`
    `void` | `reset()`

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

      `close, end`

    - ### 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

    - #### RandomTokenStream

          public RandomTokenStream(int len,
                                   String[] sampleTerms,
                                   BytesRef[] sampleTermBytes)

  - ### Method Detail

    - #### randomPayload

          protected BytesRef randomPayload()

    - #### hasPayloads

          public boolean hasPayloads()

    - #### getTerms

          public String[] getTerms()

    - #### getTermBytes

          public BytesRef[] getTermBytes()

    - #### getPositionsIncrements

          public int[] getPositionsIncrements()

    - #### getStartOffsets

          public int[] getStartOffsets()

    - #### getEndOffsets

          public int[] getEndOffsets()

    - #### getPayloads

          public BytesRef[] getPayloads()

    - #### reset

          public void reset()
                     throws IOException

      Overrides:
        `reset` in class `TokenStream`
      Throws:
        `IOException`

    - #### incrementToken

          public final boolean incrementToken()
                                       throws IOException

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

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