org.apache.lucene.search.spans
Class TermSpans
- java.lang.Object
-
- org.apache.lucene.search.spans.TermSpans
-
-
Constructor Summary
Constructors Constructor and Description TermSpans(TermPositions positions, Term term)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intdoc()Returns the document number of the current match.intend()Returns the end position of the current match.TermPositionsgetPositions()booleannext()Move to the next match, returning true iff any such exists.booleanskipTo(int target)Skips to the first match beyond the current, whose document number is greater than or equal to target.intstart()Returns the start position of the current match.java.lang.StringtoString()
-
-
-
Constructor Detail
-
TermSpans
public TermSpans(TermPositions positions, Term term) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
next
public boolean next() throws java.io.IOExceptionDescription copied from interface:SpansMove to the next match, returning true iff any such exists.
-
skipTo
public boolean skipTo(int target) throws java.io.IOExceptionDescription copied from interface:SpansSkips to the first match beyond the current, whose document number is greater than or equal to target.Returns true iff there is such a match.
Behaves as if written:
boolean skipTo(int target) { do { if (!next()) return false; } while (target > doc()); return true; }Most implementations are considerably more efficient than that.
-
doc
public int doc()
Description copied from interface:SpansReturns the document number of the current match. Initially invalid.
-
start
public int start()
Description copied from interface:SpansReturns the start position of the current match. Initially invalid.
-
end
public int end()
Description copied from interface:SpansReturns the end position of the current match. Initially invalid.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getPositions
public TermPositions getPositions()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG