org.terrier.structures.postings
Class FieldIterablePosting

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

public class FieldIterablePosting
extends BasicIterablePosting
implements FieldPosting

A posting iterator for field postings.

Since:
3.0
Author:
Craig Macdonald
See Also:
Posting, IterablePosting, FieldPosting, 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
FieldIterablePosting(BitIn fileReader, int entries, DocumentIndex _doi, int _fieldCount)
          constructor
FieldIterablePosting(int _fieldCount)
          contructor
 
Method Summary
 WritablePosting asWritablePosting()
          Get this posting as a WritablePosting
 int[] getFieldFrequencies()
          Returns the frequencies of the term in each field of the document
 int[] getFieldLengths()
          Returns the lengths of the each fields in the current document
 int next()
          Move this iterator to the next posting.
 void readFields(DataInput in)
          Read this posting from specified inputstream
 void setFieldLengths(int[] fl)
          .
 String toString()
          Makes a human readable form of this posting
 void write(DataOutput out)
          Write this posting to specified outputstream
 
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

FieldIterablePosting

public FieldIterablePosting(int _fieldCount)
contructor

Parameters:
_fieldCount -

FieldIterablePosting

public FieldIterablePosting(BitIn fileReader,
                            int entries,
                            DocumentIndex _doi,
                            int _fieldCount)
                     throws IOException
constructor

Parameters:
fileReader -
entries -
_doi -
_fieldCount -
Throws:
IOException
Method Detail

getFieldFrequencies

public int[] getFieldFrequencies()
Returns the frequencies of the term in each field of the document

Specified by:
getFieldFrequencies in interface FieldPosting

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

setFieldLengths

public void setFieldLengths(int[] fl)
. This operation is unsupported.

Specified by:
setFieldLengths in interface FieldPosting

getFieldLengths

public int[] getFieldLengths()
Returns the lengths of the each fields in the current document

Specified by:
getFieldLengths in interface FieldPosting

readFields

public void readFields(DataInput in)
                throws IOException
Read this posting from specified inputstream

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
Write this posting to specified outputstream

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

asWritablePosting

public WritablePosting asWritablePosting()
Get this posting as a WritablePosting

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