Package org.terrier.realtime.memory
Class MemoryInvertedIndex.InvertedIterator
- java.lang.Object
-
- org.terrier.realtime.memory.MemoryInvertedIndex.InvertedIterator
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.util.Iterator<IterablePosting>,PostingIndexInputStream
- Enclosing class:
- MemoryInvertedIndex
public class MemoryInvertedIndex.InvertedIterator extends java.lang.Object implements PostingIndexInputStream
Inverted index iterator.
-
-
Constructor Summary
Constructors Constructor Description InvertedIterator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()PointergetCurrentPointer()Returns the pointer associated with the current postings being accessedintgetEntriesSkipped()Returns the number of entries that were skipped during a call to the next().IterablePostinggetNextPostings()Return the next IterablePosting object, or null if none defined.intgetNumberOfCurrentPostings()Returns the number of postings in the current IterablePosting objectbooleanhasNext()IterablePostingnext()voidprint()Renders the entire structure to stdoutvoidremove()
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<IterablePosting>
-
next
public IterablePosting next()
- Specified by:
nextin interfacejava.util.Iterator<IterablePosting>
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
remove
public void remove()
- Specified by:
removein interfacejava.util.Iterator<IterablePosting>
-
getNextPostings
public IterablePosting getNextPostings() throws java.io.IOException
Description copied from interface:PostingIndexInputStreamReturn the next IterablePosting object, or null if none defined. Use this method instead of hasNext() and next().- Specified by:
getNextPostingsin 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:PostingIndexInputStreamReturns the number of postings in the current IterablePosting object- Specified by:
getNumberOfCurrentPostingsin interfacePostingIndexInputStream
-
getCurrentPointer
public Pointer getCurrentPointer()
Description copied from interface:PostingIndexInputStreamReturns the pointer associated with the current postings being accessed- Specified by:
getCurrentPointerin interfacePostingIndexInputStream
-
getEntriesSkipped
public int getEntriesSkipped()
Description copied from interface:PostingIndexInputStreamReturns the number of entries that were skipped during a call to the next().- Specified by:
getEntriesSkippedin interfacePostingIndexInputStream- Returns:
- int the number of entries skipped.
-
print
public void print()
Description copied from interface:PostingIndexInputStreamRenders the entire structure to stdout- Specified by:
printin interfacePostingIndexInputStream
-
-