org.terrier.structures.postings
Class BlockIterablePosting

java.lang.Object
  extended by org.terrier.structures.postings.BasicPostingImpl
      extended by org.terrier.structures.postings.BasicIterablePosting
          extended by org.terrier.structures.postings.BlockIterablePosting
All Implemented Interfaces:
Closeable, Serializable, org.apache.hadoop.io.Writable, BlockPosting, IterablePosting, Posting, WritablePosting

public class BlockIterablePosting
extends BasicIterablePosting
implements BlockPosting

A writable block iterable posting list

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.terrier.structures.postings.BasicIterablePosting
bitFileReader, doi, numEntries
 
Fields inherited from class org.terrier.structures.postings.BasicPostingImpl
dl, id, tf
 
Fields inherited from interface org.terrier.structures.postings.IterablePosting
EOL
 
Constructor Summary
BlockIterablePosting()
          Constructs an instance of the BlockIterablePosting.
BlockIterablePosting(BitIn _bitFileReader, int _numEntries, DocumentIndex doi)
          Constructs an instance of the BlockIterablePosting.
 
Method Summary
 WritablePosting asWritablePosting()
          Copies this posting to one free of an iterator.
 int[] getPositions()
          Return positions of occurrences
 int next()
          Move this iterator to the next posting.
 void readFields(DataInput in)
          Reads the a single posting (not an iterable posting - use BitPostingIndex for that)
 String toString()
          Makes a human readable form of this posting
 void write(DataOutput out)
          Writes the current posting (not an iterable posting - use DirectInvertedOutputStream for that).
 
Methods inherited from class org.terrier.structures.postings.BasicIterablePosting
close, endOfPostings, getDocumentLength, next
 
Methods inherited from class org.terrier.structures.postings.BasicPostingImpl
getFrequency, getId, setDocumentLength, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.terrier.structures.postings.Posting
getDocumentLength, getFrequency, getId, setId
 

Constructor Detail

BlockIterablePosting

public BlockIterablePosting()
Constructs an instance of the BlockIterablePosting.


BlockIterablePosting

public BlockIterablePosting(BitIn _bitFileReader,
                            int _numEntries,
                            DocumentIndex doi)
                     throws IOException
Constructs an instance of the BlockIterablePosting.

Parameters:
_bitFileReader -
_numEntries -
doi -
Throws:
IOException
Method Detail

next

public int next()
         throws IOException
Move this iterator to the next posting.

Specified by:
next in interface IterablePosting
Overrides:
next in class BasicIterablePosting
Returns:
id of next posting, or EOL if end of posting list
Throws:
IOException

getPositions

public int[] getPositions()
Return positions of occurrences

Specified by:
getPositions in interface BlockPosting

readFields

public void readFields(DataInput in)
                throws IOException
Description copied from class: BasicPostingImpl
Reads the a single posting (not an iterable posting - use BitPostingIndex for that)

Specified by:
readFields in interface org.apache.hadoop.io.Writable
Overrides:
readFields in class BasicPostingImpl
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Description copied from class: BasicPostingImpl
Writes the current posting (not an iterable posting - use DirectInvertedOutputStream for that). Compression using this method is not expected to be comparable to bit-level compression.

Specified by:
write in interface org.apache.hadoop.io.Writable
Overrides:
write in class BasicPostingImpl
Throws:
IOException

asWritablePosting

public WritablePosting asWritablePosting()
Description copied from class: BasicIterablePosting
Copies this posting to one free of an iterator. Kind of like a clone.

Specified by:
asWritablePosting in interface Posting
Overrides:
asWritablePosting in class BasicIterablePosting
Returns:
an identical posting, but which can be maniulated free of this iterator

toString

public String toString()
Description copied from class: BasicPostingImpl
Makes a human readable form of this posting

Overrides:
toString in class BasicPostingImpl


Terrier 3.6. Copyright © 2004-2011 University of Glasgow