Package org.terrier.structures.postings
Interface IterablePosting
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
,Posting
- All Known Implementing Classes:
ANDIterablePosting
,ArrayOfBasicIterablePosting
,ArrayOfBlockFieldIterablePosting
,ArrayOfBlockIterablePosting
,ArrayOfFieldIterablePosting
,ArrayOfIdsIterablePosting
,BasicIterablePosting
,BasicIterablePostingDocidOnly
,BlockFieldIterablePosting
,BlockFieldORIterablePosting
,BlockIterablePosting
,BlockMultiDirectIterablePosting
,BlockMultiIterablePosting
,BlockORIterablePosting
,DocumentPostingList.postingIterator
,FieldIterablePosting
,FieldOnlyIterablePosting
,FieldORIterablePosting
,IterablePostingImpl
,MemoryDirectIterablePosting
,MemoryFieldsDirectIterablePosting
,MemoryFieldsIterablePosting
,MemoryIterablePosting
,MultiDirectIterablePosting
,MultiIterablePosting
,ORIterablePosting
,PhraseIterablePosting
,ProximityIterablePosting
public interface IterablePosting extends Posting, java.io.Closeable
An interface that allows a list of postings to be iterated over. Iteration takes place using the next() and next(int) methods, which move the iterator forwards. If the end of list is reached, END_OF_LIST is returned (alias EOL). Once EOL has been returned, getId() must also return EOL.- Since:
- 3.0
- Author:
- Craig Macdonald, Nicola Tonellotto
-
-
Field Summary
Fields Modifier and Type Field Description static int
END_OF_LIST
static int
EOL
Values which denotes that the end of the posting list has been reached.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
endOfPostings()
Status method to see if this posting list iterator has been finished.int
next()
Move this iterator to the next posting.int
next(int targetId)
Move this iterator to the posting with specified id, or next posting after that if a posting with the specified id does not exist.-
Methods inherited from interface org.terrier.structures.postings.Posting
asWritablePosting, getDocumentLength, getFrequency, getId, setId
-
-
-
-
Field Detail
-
EOL
static final int EOL
Values which denotes that the end of the posting list has been reached.- See Also:
- Constant Field Values
-
END_OF_LIST
static final int END_OF_LIST
- See Also:
- Constant Field Values
-
-
Method Detail
-
next
int next() throws java.io.IOException
Move this iterator to the next posting.- Returns:
- id of next posting, or EOL if end of posting list.
- Throws:
java.io.IOException
-
next
int next(int targetId) throws java.io.IOException
Move this iterator to the posting with specified id, or next posting after that if a posting with the specified id does not exist. This is usually implemented internally bynext()
, but more efficient implementations can override this behaviour.- Parameters:
targetId
- id of the posting to find in this posting list.- Returns:
- id of the posting found, or EOL if end of posting list is reached.
- Throws:
java.io.IOException
-
-