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
Modifier and TypeClassDescriptionstatic class
A view over several OffsetsEnum instances, merging them in-placestatic class
Based on aMatchesIterator
; does not look at submatches.static class
Based on aMatchesIterator
with submatches.static class
Based on aPostingsEnum
-- the typical/standard OE impl. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
int
compareTo
(OffsetsEnum other) abstract int
abstract int
freq()
An estimate of the number of occurrences of this term/OffsetsEnum.abstract BytesRef
getTerm()
The term at this position.abstract boolean
Advances to the next position and returns true, or if can't then returns false.abstract int
toString()
-
Field Details
-
EMPTY
Empty enumeration
-
-
Constructor Details
-
OffsetsEnum
public OffsetsEnum()
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
toString
-