@Override public final int nextStartPosition() throws IOException { if (atFirstInCurrentDoc) { atFirstInCurrentDoc = false; return startPos; } for (;;) { startPos = in.nextStartPosition(); if (startPos == NO_MORE_POSITIONS) { return NO_MORE_POSITIONS; } switch(accept(in)) { case YES: return startPos; case NO: break; case NO_MORE_IN_CURRENT_DOC: return startPos = NO_MORE_POSITIONS; // startPos ahead for the current doc. } } }
@Override public final int nextDoc() throws IOException { while (true) { int doc = in.nextDoc(); if (doc == NO_MORE_DOCS) { return NO_MORE_DOCS; } else if (twoPhaseCurrentDocMatches()) { return doc; } } }
@Override public final int advance(int target) throws IOException { int doc = in.advance(target); while (doc != NO_MORE_DOCS) { if (twoPhaseCurrentDocMatches()) { break; } doc = in.nextDoc(); } return doc; }
/** * Returns true if the current document matches. * <p> * This is called during two-phase processing. */ // return true if the current document matches @SuppressWarnings("fallthrough") private final boolean twoPhaseCurrentDocMatches() throws IOException { atFirstInCurrentDoc = false; startPos = in.nextStartPosition(); assert startPos != NO_MORE_POSITIONS; for (;;) { switch(accept(in)) { case YES: atFirstInCurrentDoc = true; return true; case NO: startPos = in.nextStartPosition(); if (startPos != NO_MORE_POSITIONS) { break; } // else fallthrough case NO_MORE_IN_CURRENT_DOC: startPos = -1; return false; } } }
@Override public final int nextDoc() throws IOException { while (true) { int doc = in.nextDoc(); if (doc == NO_MORE_DOCS) { return NO_MORE_DOCS; } else if (twoPhaseCurrentDocMatches()) { return doc; } } }
@Override public final int nextStartPosition() throws IOException { if (atFirstInCurrentDoc) { atFirstInCurrentDoc = false; return startPos; } for (;;) { startPos = in.nextStartPosition(); if (startPos == NO_MORE_POSITIONS) { return NO_MORE_POSITIONS; } switch(accept(in)) { case YES: return startPos; case NO: break; case NO_MORE_IN_CURRENT_DOC: return startPos = NO_MORE_POSITIONS; // startPos ahead for the current doc. } } }
@Override public final int nextDoc() throws IOException { while (true) { int doc = in.nextDoc(); if (doc == NO_MORE_DOCS) { return NO_MORE_DOCS; } else if (twoPhaseCurrentDocMatches()) { return doc; } } }
@Override public final int nextStartPosition() throws IOException { if (atFirstInCurrentDoc) { atFirstInCurrentDoc = false; return startPos; } for (;;) { startPos = in.nextStartPosition(); if (startPos == NO_MORE_POSITIONS) { return NO_MORE_POSITIONS; } switch(accept(in)) { case YES: return startPos; case NO: break; case NO_MORE_IN_CURRENT_DOC: return startPos = NO_MORE_POSITIONS; // startPos ahead for the current doc. } } }
@Override public final int nextDoc() throws IOException { while (true) { int doc = in.nextDoc(); if (doc == NO_MORE_DOCS) { return NO_MORE_DOCS; } else if (twoPhaseCurrentDocMatches()) { return doc; } } }
@Override public final int nextStartPosition() throws IOException { if (atFirstInCurrentDoc) { atFirstInCurrentDoc = false; return startPos; } for (;;) { startPos = in.nextStartPosition(); if (startPos == NO_MORE_POSITIONS) { return NO_MORE_POSITIONS; } switch(accept(in)) { case YES: return startPos; case NO: break; case NO_MORE_IN_CURRENT_DOC: return startPos = NO_MORE_POSITIONS; // startPos ahead for the current doc. } } }
@Override public final int advance(int target) throws IOException { int doc = in.advance(target); while (doc != NO_MORE_DOCS) { if (twoPhaseCurrentDocMatches()) { break; } doc = in.nextDoc(); } return doc; }
/** * Returns true if the current document matches. * <p> * This is called during two-phase processing. */ // return true if the current document matches @SuppressWarnings("fallthrough") private final boolean twoPhaseCurrentDocMatches() throws IOException { atFirstInCurrentDoc = false; startPos = in.nextStartPosition(); assert startPos != NO_MORE_POSITIONS; for (;;) { switch(accept(in)) { case YES: atFirstInCurrentDoc = true; return true; case NO: startPos = in.nextStartPosition(); if (startPos != NO_MORE_POSITIONS) { break; } // else fallthrough case NO_MORE_IN_CURRENT_DOC: startPos = -1; return false; } } }
@Override public final int advance(int target) throws IOException { int doc = in.advance(target); while (doc != NO_MORE_DOCS) { if (twoPhaseCurrentDocMatches()) { break; } doc = in.nextDoc(); } return doc; }
/** * Returns true if the current document matches. * <p> * This is called during two-phase processing. */ // return true if the current document matches @SuppressWarnings("fallthrough") private final boolean twoPhaseCurrentDocMatches() throws IOException { atFirstInCurrentDoc = false; startPos = in.nextStartPosition(); assert startPos != NO_MORE_POSITIONS; for (;;) { switch(accept(in)) { case YES: atFirstInCurrentDoc = true; return true; case NO: startPos = in.nextStartPosition(); if (startPos != NO_MORE_POSITIONS) { break; } // else fallthrough case NO_MORE_IN_CURRENT_DOC: startPos = -1; return false; } } }
@Override public final int advance(int target) throws IOException { int doc = in.advance(target); while (doc != NO_MORE_DOCS) { if (twoPhaseCurrentDocMatches()) { break; } doc = in.nextDoc(); } return doc; }
/** * Returns true if the current document matches. * <p> * This is called during two-phase processing. */ // return true if the current document matches @SuppressWarnings("fallthrough") private final boolean twoPhaseCurrentDocMatches() throws IOException { atFirstInCurrentDoc = false; startPos = in.nextStartPosition(); assert startPos != NO_MORE_POSITIONS; for (;;) { switch(accept(in)) { case YES: atFirstInCurrentDoc = true; return true; case NO: startPos = in.nextStartPosition(); if (startPos != NO_MORE_POSITIONS) { break; } // else fallthrough case NO_MORE_IN_CURRENT_DOC: startPos = -1; return false; } } }