org.apache.lucene.search.uhighlight

## Class OffsetsEnum

- java.lang.Object
- - org.apache.lucene.search.uhighlight.OffsetsEnum

- All Implemented Interfaces:
    Closeable, AutoCloseable, Comparable<OffsetsEnum>

      public class OffsetsEnum
      extends Object
      implements Comparable<OffsetsEnum>, Closeable

  Holds the term (`BytesRef`), `PostingsEnum`, offset iteration tracking. It is advanced with the underlying postings and is placed in a priority queue by `FieldHighlighter.highlightOffsetsEnums(List)` based on the start offset.
  NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OffsetsEnum(BytesRef term, PostingsEnum postingsEnum)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `int` | `compareTo(OffsetsEnum other)`
    `int` | `endOffset()`
    `int` | `freq()`
    `PostingsEnum` | `getPostingsEnum()`
    `BytesRef` | `getTerm()` The term at this position; usually always the same.
    `float` | `getWeight()`
    `boolean` | `hasMorePositions()`
    `void` | `nextPosition()`
    `void` | `setWeight(float weight)`
    `int` | `startOffset()`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### OffsetsEnum

          public OffsetsEnum(BytesRef term,
                             PostingsEnum postingsEnum)
                      throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### compareTo

          public int compareTo(OffsetsEnum other)

      Specified by:
        `compareTo` in interface `Comparable<OffsetsEnum>`

    - #### getTerm

          public BytesRef getTerm()
                           throws IOException

      The term at this position; usually always the same. This term is a reference that is safe to continue to refer to, even after we move to next position.
      Throws:
        `IOException`

    - #### getPostingsEnum

          public PostingsEnum getPostingsEnum()

    - #### freq

          public int freq()
                   throws IOException

      Throws:
        `IOException`

    - #### hasMorePositions

          public boolean hasMorePositions()
                                   throws IOException

      Throws:
        `IOException`

    - #### nextPosition

          public void nextPosition()
                            throws IOException

      Throws:
        `IOException`

    - #### startOffset

          public int startOffset()
                          throws IOException

      Throws:
        `IOException`

    - #### endOffset

          public int endOffset()
                        throws IOException

      Throws:
        `IOException`

    - #### getWeight

          public float getWeight()

    - #### setWeight

          public void setWeight(float weight)

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

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