Returns true iff there is such an entry.
Behaves as if written:
boolean skipTo(int target) { do { if (!next()) return false; } while (target > doc()); return true; }
134135136137138139140141142143144
assertEquals(aprioriTermDocs.next(), testTermDocs.next()); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); if (aprioriTermDocs.skipTo(4)) { assertTrue(testTermDocs.skipTo(4)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(4)); }
138139140141142143144145146147148
if (aprioriTermDocs.skipTo(4)) { assertTrue(testTermDocs.skipTo(4)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(4)); } if (aprioriTermDocs.next()) { assertTrue(testTermDocs.next()); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq());
153154155156157158159160161162163
// beyond this point all next and skipto will return false if (aprioriTermDocs.skipTo(100)) { assertTrue(testTermDocs.skipTo(100)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(100)); }
157158159160161162163164165166167
if (aprioriTermDocs.skipTo(100)) { assertTrue(testTermDocs.skipTo(100)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(100)); } if (aprioriTermDocs.next()) { assertTrue(testTermDocs.next());
170171172173174175176177178179180
} else { assertFalse(testTermDocs.next()); } if (aprioriTermDocs.skipTo(110)) { assertTrue(testTermDocs.skipTo(110)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(110)); }
174175176177178179180181182183184
if (aprioriTermDocs.skipTo(110)) { assertTrue(testTermDocs.skipTo(110)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(110)); } if (aprioriTermDocs.skipTo(10)) { assertTrue(testTermDocs.skipTo(10)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq());
178179180181182183184185186187188
} else { assertFalse(testTermDocs.skipTo(110)); } if (aprioriTermDocs.skipTo(10)) { assertTrue(testTermDocs.skipTo(10)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(10)); }
182183184185186187188189190191192
if (aprioriTermDocs.skipTo(10)) { assertTrue(testTermDocs.skipTo(10)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(10)); } if (aprioriTermDocs.skipTo(210)) { assertTrue(testTermDocs.skipTo(210));
187188189190191192193194195196197
assertFalse(testTermDocs.skipTo(10)); } if (aprioriTermDocs.skipTo(210)) { assertTrue(testTermDocs.skipTo(210)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(210)); }
191192193194195196197198199200201
if (aprioriTermDocs.skipTo(210)) { assertTrue(testTermDocs.skipTo(210)); assertEquals(aprioriTermDocs.freq(), testTermDocs.freq()); assertEquals(aprioriTermDocs.doc(), testTermDocs.doc()); } else { assertFalse(testTermDocs.skipTo(210)); } aprioriTermDocs.close(); testTermDocs.close();