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
public abstract class OffsetsEnum extends Object implements Comparable<OffsetsEnum>, Closeable
An enumeration/iterator of a term and its offsets for use byFieldHighlighter. It is advanced and is placed in a priority queue byFieldHighlighter.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 Classes Modifier and Type Class Description static classOffsetsEnum.MultiOffsetsEnumA view over several OffsetsEnum instances, merging them in-placestatic classOffsetsEnum.OfMatchesIteratorBased on aMatchesIterator; does not look at submatches.static classOffsetsEnum.OfMatchesIteratorWithSubsBased on aMatchesIteratorwith submatches.static classOffsetsEnum.OfPostingsBased on aPostingsEnum-- the typical/standard OE impl.
-
Field Summary
Fields Modifier and Type Field Description static OffsetsEnumEMPTYEmpty enumeration
-
Constructor Summary
Constructors Constructor Description OffsetsEnum()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()intcompareTo(OffsetsEnum other)abstract intendOffset()abstract intfreq()An estimate of the number of occurrences of this term/OffsetsEnum.abstract BytesRefgetTerm()The term at this position.abstract booleannextPosition()Advances to the next position and returns true, or if can't then returns false.abstract intstartOffset()StringtoString()
-
-
-
Field Detail
-
EMPTY
public static final OffsetsEnum EMPTY
Empty enumeration
-
-
Method Detail
-
compareTo
public int compareTo(OffsetsEnum other)
- Specified by:
compareToin interfaceComparable<OffsetsEnum>
-
nextPosition
public abstract boolean nextPosition() throws IOExceptionAdvances 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
public abstract int freq() throws IOExceptionAn estimate of the number of occurrences of this term/OffsetsEnum.- Throws:
IOException
-
getTerm
public abstract BytesRef getTerm() throws IOException
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:
Passage.getMatchTerms()
-
startOffset
public abstract int startOffset() throws IOException- Throws:
IOException
-
endOffset
public abstract int endOffset() throws IOException- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-