Module org.apache.lucene.queries
Class CachingMatchesIterator
java.lang.Object
org.apache.lucene.search.FilterMatchesIterator
org.apache.lucene.queries.intervals.CachingMatchesIterator
- All Implemented Interfaces:
IntervalMatchesIterator
,MatchesIterator
-
Field Summary
FieldsFields inherited from class org.apache.lucene.search.FilterMatchesIterator
in
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
cache()
int
The ending offset of the current match, or-1
if offsets are not availableint
gaps()
The number of top-level gaps inside the current matchgetQuery()
Returns the Query causing the current matchReturns a MatchesIterator that iterates over the positions and offsets of individual terms within the current matchboolean
next()
Advance the iterator to the next match positionint
The starting offset of the current match, or-1
if offsets are not availableint
width()
The width of the current matchMethods inherited from class org.apache.lucene.search.FilterMatchesIterator
endPosition, startPosition
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.lucene.search.MatchesIterator
endPosition, startPosition
-
Field Details
-
posAndOffsets
private int[] posAndOffsets -
matchingQueries
-
count
private int count
-
-
Constructor Details
-
CachingMatchesIterator
CachingMatchesIterator(IntervalMatchesIterator in)
-
-
Method Details
-
cache
- Throws:
IOException
-
next
Description copied from interface:MatchesIterator
Advance the iterator to the next match position- Specified by:
next
in interfaceMatchesIterator
- Overrides:
next
in classFilterMatchesIterator
- Returns:
true
if matches have not been exhausted- Throws:
IOException
-
startOffset
Description copied from interface:MatchesIterator
The starting offset of the current match, or-1
if offsets are not availableShould only be called after
MatchesIterator.next()
has returnedtrue
- Specified by:
startOffset
in interfaceMatchesIterator
- Overrides:
startOffset
in classFilterMatchesIterator
- Throws:
IOException
-
endOffset
Description copied from interface:MatchesIterator
The ending offset of the current match, or-1
if offsets are not availableShould only be called after
MatchesIterator.next()
has returnedtrue
- Specified by:
endOffset
in interfaceMatchesIterator
- Overrides:
endOffset
in classFilterMatchesIterator
- Throws:
IOException
-
getSubMatches
Description copied from interface:MatchesIterator
Returns a MatchesIterator that iterates over the positions and offsets of individual terms within the current matchReturns
null
if there are no submatches (ie the current iterator is at the leaf level)Should only be called after
MatchesIterator.next()
has returnedtrue
- Specified by:
getSubMatches
in interfaceMatchesIterator
- Overrides:
getSubMatches
in classFilterMatchesIterator
-
getQuery
Description copied from interface:MatchesIterator
Returns the Query causing the current matchIf this
MatchesIterator
has been returned from aMatchesIterator.getSubMatches()
call, then returns aTermQuery
equivalent to the current matchShould only be called after
MatchesIterator.next()
has returnedtrue
- Specified by:
getQuery
in interfaceMatchesIterator
- Overrides:
getQuery
in classFilterMatchesIterator
-
gaps
public int gaps()Description copied from interface:IntervalMatchesIterator
The number of top-level gaps inside the current match- Specified by:
gaps
in interfaceIntervalMatchesIterator
- See Also:
-
width
public int width()Description copied from interface:IntervalMatchesIterator
The width of the current match- Specified by:
width
in interfaceIntervalMatchesIterator
- See Also:
-