| org.apache.lucene.search.spans.Spans
All known Subclasses: org.apache.lucene.search.spans.NearSpansUnordered, org.apache.lucene.search.spans.TermSpans, org.apache.lucene.search.spans.NearSpansOrdered,
Spans | public interface Spans (Code) | | Expert: an enumeration of span matches. Used to implement span searching.
Each span represents a range of term positions within a document. Matches
are enumerated in order, by increasing document number, within that by
increasing start position and finally by increasing end position.
|
Method Summary | |
int | doc() Returns the document number of the current match. | int | end() Returns the end position of the current match. | boolean | next() Move to the next match, returning true iff any such exists. | boolean | skipTo(int target) Skips to the first match beyond the current, whose document number is
greater than or equal to target. | int | start() Returns the start position of the current match. |
doc | int doc()(Code) | | Returns the document number of the current match. Initially invalid.
|
end | int end()(Code) | | Returns the end position of the current match. Initially invalid.
|
next | boolean next() throws IOException(Code) | | Move to the next match, returning true iff any such exists.
|
skipTo | boolean skipTo(int target) throws IOException(Code) | | Skips 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.
|
start | int start()(Code) | | Returns the start position of the current match. Initially invalid.
|
|
|