|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectNearSpans.SpansCell
private class NearSpans.SpansCell
Wraps a Spans, and can be used to form a linked list.
Field Summary | |
---|---|
private int |
index
|
private int |
length
|
private NearSpans.SpansCell |
nextCell
|
private NearSpans.SpansCell |
prevCell
|
private float |
score
|
private Spans |
spans
|
Constructor Summary | |
---|---|
NearSpans.SpansCell(Spans spans,
int index)
|
Method Summary | |
---|---|
void |
adjustPosition()
|
private void |
checkList()
Debugging only: check that the links are all correct |
void |
collectTerms(Set terms)
|
int |
doc()
Returns the document number of the current match. |
int |
end()
Returns the end position of the current match. |
Explanation |
explain()
Returns an explanation of how the score was arrived at. |
private void |
fixLinks()
Helper function for linkAfter and linkBefore |
private boolean |
lessThan(NearSpans.SpansCell otherCell)
Ordering function for cells in the list |
private void |
linkAfter(NearSpans.SpansCell other)
Link the cell into the list just after 'other', or at the head if null |
private void |
linkBefore(NearSpans.SpansCell other)
Link the cell into the list just before 'other', or at the tail if null |
boolean |
next()
Move to the next match, returning true iff any such exists. |
private void |
postChange()
Called just after advancing the cell |
private void |
preChange()
Called just before advancing the cell |
float |
score()
Returns the score of the current match. |
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. |
String |
toString()
|
private void |
unlink()
Remove the current cell from the linked list |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private Spans spans
private NearSpans.SpansCell prevCell
private NearSpans.SpansCell nextCell
private int length
private float score
private int index
Constructor Detail |
---|
public NearSpans.SpansCell(Spans spans, int index)
Method Detail |
---|
public boolean next() throws IOException
Spans
next
in interface Spans
IOException
public boolean skipTo(int target) throws IOException
Spans
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.
skipTo
in interface Spans
IOException
private void preChange()
private void postChange()
public void adjustPosition()
private void unlink()
private void linkBefore(NearSpans.SpansCell other)
private void linkAfter(NearSpans.SpansCell other)
private void fixLinks()
private void checkList()
private final boolean lessThan(NearSpans.SpansCell otherCell)
public int doc()
Spans
doc
in interface Spans
public int start()
Spans
start
in interface Spans
public int end()
Spans
end
in interface Spans
public float score()
Spans
score
in interface Spans
public Explanation explain() throws IOException
Spans
explain
in interface Spans
IOException
public void collectTerms(Set terms)
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |