Class OffsetsEnum
- java.lang.Object
-
- org.apache.lucene.search.uhighlight.OffsetsEnum
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Comparable<OffsetsEnum>
- Direct Known Subclasses:
OffsetsEnum.MultiOffsetsEnum
,OffsetsEnum.OfMatchesIterator
,OffsetsEnum.OfMatchesIteratorWithSubs
,OffsetsEnum.OfMatchesIteratorWithSubs.CachedOE
,OffsetsEnum.OfPostings
,PhraseHelper.SpanCollectedOffsetsEnum
,TokenStreamOffsetStrategy.TokenStreamOffsetsEnum
public abstract class OffsetsEnum extends java.lang.Object implements java.lang.Comparable<OffsetsEnum>, java.io.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OffsetsEnum.MultiOffsetsEnum
A view over several OffsetsEnum instances, merging them in-placestatic class
OffsetsEnum.OfMatchesIterator
Based on aMatchesIterator
; does not look at submatches.static class
OffsetsEnum.OfMatchesIteratorWithSubs
Based on aMatchesIterator
with submatches.static class
OffsetsEnum.OfPostings
Based on aPostingsEnum
-- the typical/standard OE impl.
-
Field Summary
Fields Modifier and Type Field Description static OffsetsEnum
EMPTY
Empty enumeration
-
Constructor Summary
Constructors Constructor Description OffsetsEnum()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
int
compareTo(OffsetsEnum other)
abstract int
endOffset()
abstract int
freq()
An estimate of the number of occurrences of this term/OffsetsEnum.abstract BytesRef
getTerm()
The term at this position.abstract boolean
nextPosition()
Advances to the next position and returns true, or if can't then returns false.abstract int
startOffset()
java.lang.String
toString()
-
-
-
Field Detail
-
EMPTY
public static final OffsetsEnum EMPTY
Empty enumeration
-
-
Method Detail
-
compareTo
public int compareTo(OffsetsEnum other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<OffsetsEnum>
-
nextPosition
public abstract boolean nextPosition() throws java.io.IOException
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:
java.io.IOException
-
freq
public abstract int freq() throws java.io.IOException
An estimate of the number of occurrences of this term/OffsetsEnum.- Throws:
java.io.IOException
-
getTerm
public abstract BytesRef getTerm() throws java.io.IOException
The term at this position. This BytesRef is safe to continue to refer to, even after we move to the next position.- Throws:
java.io.IOException
- See Also:
Passage.getMatchTerms()
-
startOffset
public abstract int startOffset() throws java.io.IOException
- Throws:
java.io.IOException
-
endOffset
public abstract int endOffset() throws java.io.IOException
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-