Class CachingMatchesIterator
- java.lang.Object
-
- org.apache.lucene.search.FilterMatchesIterator
-
- org.apache.lucene.queries.intervals.CachingMatchesIterator
-
- All Implemented Interfaces:
IntervalMatchesIterator,MatchesIterator
class CachingMatchesIterator extends FilterMatchesIterator implements IntervalMatchesIterator
-
-
Field Summary
Fields Modifier and Type Field Description private intcountprivate Query[]matchingQueriesprivate int[]posAndOffsets-
Fields inherited from class org.apache.lucene.search.FilterMatchesIterator
in
-
-
Constructor Summary
Constructors Constructor Description CachingMatchesIterator(IntervalMatchesIterator in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcache()intendOffset()The ending offset of the current match, or-1if offsets are not availableintgaps()The number of top-level gaps inside the current matchQuerygetQuery()Returns the Query causing the current matchMatchesIteratorgetSubMatches()Returns a MatchesIterator that iterates over the positions and offsets of individual terms within the current matchbooleannext()Advance the iterator to the next match positionintstartOffset()The starting offset of the current match, or-1if offsets are not availableintwidth()The width of the current match-
Methods 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 Detail
-
posAndOffsets
private int[] posAndOffsets
-
matchingQueries
private Query[] matchingQueries
-
count
private int count
-
-
Constructor Detail
-
CachingMatchesIterator
CachingMatchesIterator(IntervalMatchesIterator in)
-
-
Method Detail
-
cache
void cache() throws java.io.IOException- Throws:
java.io.IOException
-
next
public boolean next() throws java.io.IOExceptionDescription copied from interface:MatchesIteratorAdvance the iterator to the next match position- Specified by:
nextin interfaceMatchesIterator- Overrides:
nextin classFilterMatchesIterator- Returns:
trueif matches have not been exhausted- Throws:
java.io.IOException
-
startOffset
public int startOffset() throws java.io.IOExceptionDescription copied from interface:MatchesIteratorThe starting offset of the current match, or-1if offsets are not availableShould only be called after
MatchesIterator.next()has returnedtrue- Specified by:
startOffsetin interfaceMatchesIterator- Overrides:
startOffsetin classFilterMatchesIterator- Throws:
java.io.IOException
-
endOffset
public int endOffset() throws java.io.IOExceptionDescription copied from interface:MatchesIteratorThe ending offset of the current match, or-1if offsets are not availableShould only be called after
MatchesIterator.next()has returnedtrue- Specified by:
endOffsetin interfaceMatchesIterator- Overrides:
endOffsetin classFilterMatchesIterator- Throws:
java.io.IOException
-
getSubMatches
public MatchesIterator getSubMatches()
Description copied from interface:MatchesIteratorReturns a MatchesIterator that iterates over the positions and offsets of individual terms within the current matchReturns
nullif there are no submatches (ie the current iterator is at the leaf level)Should only be called after
MatchesIterator.next()has returnedtrue- Specified by:
getSubMatchesin interfaceMatchesIterator- Overrides:
getSubMatchesin classFilterMatchesIterator
-
getQuery
public Query getQuery()
Description copied from interface:MatchesIteratorReturns the Query causing the current matchIf this
MatchesIteratorhas been returned from aMatchesIterator.getSubMatches()call, then returns aTermQueryequivalent to the current matchShould only be called after
MatchesIterator.next()has returnedtrue- Specified by:
getQueryin interfaceMatchesIterator- Overrides:
getQueryin classFilterMatchesIterator
-
gaps
public int gaps()
Description copied from interface:IntervalMatchesIteratorThe number of top-level gaps inside the current match- Specified by:
gapsin interfaceIntervalMatchesIterator- See Also:
IntervalIterator.gaps()
-
width
public int width()
Description copied from interface:IntervalMatchesIteratorThe width of the current match- Specified by:
widthin interfaceIntervalMatchesIterator- See Also:
IntervalIterator.width()
-
-