Package org.terrier.realtime.memory
Class MemoryDirectIndex.DirectIterator
- java.lang.Object
-
- org.terrier.realtime.memory.MemoryDirectIndex.DirectIterator
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.util.Iterator<IterablePosting>
,PostingIndexInputStream
- Enclosing class:
- MemoryDirectIndex
protected class MemoryDirectIndex.DirectIterator extends java.lang.Object implements PostingIndexInputStream
Direct index iterator.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DirectIterator(java.util.Iterator<java.util.Map.Entry<java.lang.Integer,DocumentIndexEntry>> _doiIter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Pointer
getCurrentPointer()
Returns the pointer associated with the current postings being accessedint
getEntriesSkipped()
Returns the number of entries that were skipped during a call to the next().IterablePosting
getNextPostings()
Return the next IterablePosting object, or null if none defined.int
getNumberOfCurrentPostings()
Returns the number of postings in the current IterablePosting objectboolean
hasNext()
IterablePosting
next()
void
print()
Renders the entire structure to stdoutvoid
remove()
-
-
-
Constructor Detail
-
DirectIterator
protected DirectIterator(java.util.Iterator<java.util.Map.Entry<java.lang.Integer,DocumentIndexEntry>> _doiIter)
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<IterablePosting>
-
next
public IterablePosting next()
- Specified by:
next
in interfacejava.util.Iterator<IterablePosting>
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
remove
public void remove()
- Specified by:
remove
in interfacejava.util.Iterator<IterablePosting>
-
getNextPostings
public IterablePosting getNextPostings() throws java.io.IOException
Description copied from interface:PostingIndexInputStream
Return the next IterablePosting object, or null if none defined. Use this method instead of hasNext() and next().- Specified by:
getNextPostings
in interfacePostingIndexInputStream
- Returns:
- IterablePosting postings for next object
- Throws:
java.io.IOException
- if an I/O problem occurs.
-
getNumberOfCurrentPostings
public int getNumberOfCurrentPostings()
Description copied from interface:PostingIndexInputStream
Returns the number of postings in the current IterablePosting object- Specified by:
getNumberOfCurrentPostings
in interfacePostingIndexInputStream
-
getCurrentPointer
public Pointer getCurrentPointer()
Description copied from interface:PostingIndexInputStream
Returns the pointer associated with the current postings being accessed- Specified by:
getCurrentPointer
in interfacePostingIndexInputStream
-
getEntriesSkipped
public int getEntriesSkipped()
Description copied from interface:PostingIndexInputStream
Returns the number of entries that were skipped during a call to the next().- Specified by:
getEntriesSkipped
in interfacePostingIndexInputStream
- Returns:
- int the number of entries skipped.
-
print
public void print()
Description copied from interface:PostingIndexInputStream
Renders the entire structure to stdout- Specified by:
print
in interfacePostingIndexInputStream
-
-