Class OffsetsEnum
java.lang.Object
org.apache.lucene.search.uhighlight.OffsetsEnum
- All Implemented Interfaces:
Closeable,AutoCloseable,Comparable<OffsetsEnum>
- Direct Known Subclasses:
OffsetsEnum.MultiOffsetsEnum,OffsetsEnum.OfMatchesIterator,OffsetsEnum.OfMatchesIteratorWithSubs,OffsetsEnum.OfPostings
An enumeration/iterator of a term and its offsets for use by
FieldHighlighter. It is
advanced and is placed in a priority queue by FieldHighlighter.highlightOffsetsEnums(OffsetsEnum) based on the start offset.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA view over several OffsetsEnum instances, merging them in-placestatic classBased on aMatchesIterator; does not look at submatches.static classBased on aMatchesIteratorwith submatches.static classBased on aPostingsEnum-- the typical/standard OE impl. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intcompareTo(OffsetsEnum other) abstract intabstract intfreq()An estimate of the number of occurrences of this term/OffsetsEnum.abstract BytesRefgetTerm()The term at this position.abstract booleanAdvances to the next position and returns true, or if can't then returns false.abstract inttoString()
-
Field Details
-
EMPTY
Empty enumeration
-
-
Constructor Details
-
OffsetsEnum
public OffsetsEnum()
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<OffsetsEnum>
-
nextPosition
Advances to the next position and returns true, or if can't then returns false. Note that the initial state of this class is not positioned.- Throws:
IOException
-
freq
An estimate of the number of occurrences of this term/OffsetsEnum.- Throws:
IOException
-
getTerm
The term at this position. This BytesRef is safe to continue to refer to, even after we move to the next position.- Throws:
IOException- See Also:
-
startOffset
- Throws:
IOException
-
endOffset
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
toString
-