org.apache.lucene.search.spans
Interface Spans
-
- All Known Implementing Classes:
- TermSpans
public interface SpansExpert: 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
All Methods Instance Methods Abstract 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.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.
-
-
-
Method Detail
-
next
boolean next() throws java.io.IOExceptionMove to the next match, returning true iff any such exists.- Throws:
java.io.IOException
-
skipTo
boolean skipTo(int target) throws java.io.IOExceptionSkips 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.- Throws:
java.io.IOException
-
doc
int doc()
Returns the document number of the current match. Initially invalid.
-
start
int start()
Returns the start position of the current match. Initially invalid.
-
end
int end()
Returns the end position of the current match. Initially invalid.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG