Package org.apache.lucene.search
Class TermMatchesIterator
- java.lang.Object
-
- org.apache.lucene.search.TermMatchesIterator
-
- All Implemented Interfaces:
MatchesIterator
class TermMatchesIterator extends java.lang.Object implements MatchesIterator
AMatchesIteratorover a single term's postings list
-
-
Constructor Summary
Constructors Constructor Description TermMatchesIterator(Query query, PostingsEnum pe)Create a newTermMatchesIteratorfor the given term and postings list
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intendOffset()The ending offset of the current match, or-1if offsets are not availableintendPosition()The end position of 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 availableintstartPosition()The start position of the current match
-
-
-
Field Detail
-
upto
private int upto
-
pos
private int pos
-
pe
private final PostingsEnum pe
-
query
private final Query query
-
-
Constructor Detail
-
TermMatchesIterator
TermMatchesIterator(Query query, PostingsEnum pe) throws java.io.IOException
Create a newTermMatchesIteratorfor the given term and postings list- Throws:
java.io.IOException
-
-
Method Detail
-
next
public boolean next() throws java.io.IOExceptionDescription copied from interface:MatchesIteratorAdvance the iterator to the next match position- Specified by:
nextin interfaceMatchesIterator- Returns:
trueif matches have not been exhausted- Throws:
java.io.IOException
-
startPosition
public int startPosition()
Description copied from interface:MatchesIteratorThe start position of the current matchShould only be called after
MatchesIterator.next()has returnedtrue- Specified by:
startPositionin interfaceMatchesIterator
-
endPosition
public int endPosition()
Description copied from interface:MatchesIteratorThe end position of the current matchShould only be called after
MatchesIterator.next()has returnedtrue- Specified by:
endPositionin interfaceMatchesIterator
-
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- 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- Throws:
java.io.IOException
-
getSubMatches
public MatchesIterator getSubMatches() throws java.io.IOException
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- Throws:
java.io.IOException
-
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
-
-