private boolean atMatch() { assert minPositionCell().docID() == maxEndPositionCell.docID(); return (maxEndPositionCell.endPosition() - minPositionCell().startPosition() - totalSpanLength) <= allowedSlop; }
private boolean atMatch() { assert minPositionCell().docID() == maxEndPositionCell.docID(); return (maxEndPositionCell.endPosition() - minPositionCell().startPosition() - totalSpanLength) <= allowedSlop; }
@Override public int endPosition() { return atFirstInCurrentDoc ? -1 : oneExhaustedInCurrentDoc ? NO_MORE_POSITIONS : maxEndPositionCell.endPosition(); }
private void adjustMax() { assert docID() == maxEndPositionCell.docID(); if (endPosition() > maxEndPositionCell.endPosition()) { maxEndPositionCell = this; } }
private void adjustLength() { if (spanLength != -1) { totalSpanLength -= spanLength; // subtract old, possibly from a previous doc } assert in.startPosition() != NO_MORE_POSITIONS; spanLength = endPosition() - startPosition(); assert spanLength >= 0; totalSpanLength += spanLength; // add new }
private void adjustMax() { assert docID() == maxEndPositionCell.docID(); if (endPosition() > maxEndPositionCell.endPosition()) { maxEndPositionCell = this; } }
@Override public int endPosition() { return atFirstInCurrentDoc ? -1 : oneExhaustedInCurrentDoc ? NO_MORE_POSITIONS : maxEndPositionCell.endPosition(); }
private void adjustLength() { if (spanLength != -1) { totalSpanLength -= spanLength; // subtract old, possibly from a previous doc } assert in.startPosition() != NO_MORE_POSITIONS; spanLength = endPosition() - startPosition(); assert spanLength >= 0; totalSpanLength += spanLength; // add new }