| 1 | |
|
| 2 | |
package org.galagosearch.core.retrieval.structured; |
| 3 | |
|
| 4 | |
import java.io.IOException; |
| 5 | |
import org.galagosearch.core.util.ExtentArray; |
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | 176 | public abstract class ExtentIterator extends CountIterator { |
| 14 | |
public abstract void nextDocument() throws IOException; |
| 15 | |
public abstract int document(); |
| 16 | |
public abstract int count(); |
| 17 | |
public abstract ExtentArray extents(); |
| 18 | |
public abstract boolean isDone(); |
| 19 | |
public abstract void reset() throws IOException; |
| 20 | |
|
| 21 | |
@Override |
| 22 | |
public boolean skipToDocument(int document) throws IOException { |
| 23 | 68 | if (isDone()) { |
| 24 | 0 | return false; |
| 25 | |
} |
| 26 | 140 | while (!isDone() && document() < document) { |
| 27 | 72 | nextDocument(); |
| 28 | |
} |
| 29 | 68 | return !isDone() && document == document(); |
| 30 | |
} |
| 31 | |
} |