Class MemoryFieldsIterablePosting
- java.lang.Object
-
- org.terrier.structures.postings.IterablePostingImpl
-
- org.terrier.realtime.memory.MemoryIterablePosting
-
- org.terrier.realtime.memory.fields.MemoryFieldsIterablePosting
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,FieldPosting
,IterablePosting
,Posting
public class MemoryFieldsIterablePosting extends MemoryIterablePosting implements FieldPosting
Iterable posting (fields).- Since:
- 4.0
- Author:
- Stuart Mackie
-
-
Field Summary
-
Fields inherited from class org.terrier.realtime.memory.MemoryIterablePosting
doi, id, index, pl_doc
-
Fields inherited from interface org.terrier.structures.postings.IterablePosting
END_OF_LIST, EOL
-
-
Constructor Summary
Constructors Constructor Description MemoryFieldsIterablePosting(DocumentIndex docindex, gnu.trove.TIntArrayList docids, gnu.trove.TIntArrayList freqs, gnu.trove.TIntObjectHashMap<int[]> fields)
Constructor (docid,freq,(fields)).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WritablePosting
asWritablePosting()
Copy this posting to one free of an iterator.int[]
getFieldFrequencies()
Returns the frequencies of the term in each field of the document.int[]
getFieldLengths()
Returns the lengths of the each field in the current document.void
setFieldLengths(int[] newLengths)
-
Methods inherited from class org.terrier.realtime.memory.MemoryIterablePosting
close, endOfPostings, getDocumentLength, getFrequency, getId, next
-
Methods inherited from class org.terrier.structures.postings.IterablePostingImpl
next
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.terrier.structures.postings.Posting
getDocumentLength, getFrequency, getId, setId
-
-
-
-
Constructor Detail
-
MemoryFieldsIterablePosting
public MemoryFieldsIterablePosting(DocumentIndex docindex, gnu.trove.TIntArrayList docids, gnu.trove.TIntArrayList freqs, gnu.trove.TIntObjectHashMap<int[]> fields)
Constructor (docid,freq,(fields)).
-
-
Method Detail
-
getFieldFrequencies
public int[] getFieldFrequencies()
Returns the frequencies of the term in each field of the document.- Specified by:
getFieldFrequencies
in interfaceFieldPosting
- Returns:
- the frequencies of the term in each field of the document.
-
getFieldLengths
public int[] getFieldLengths()
Returns the lengths of the each field in the current document.- Specified by:
getFieldLengths
in interfaceFieldPosting
- Returns:
- the lengths of the each field in the current document.
-
setFieldLengths
public void setFieldLengths(int[] newLengths)
- Specified by:
setFieldLengths
in interfaceFieldPosting
-
asWritablePosting
public WritablePosting asWritablePosting()
Copy this posting to one free of an iterator. Kind of like a clone.- Specified by:
asWritablePosting
in interfacePosting
- Overrides:
asWritablePosting
in classMemoryIterablePosting
- Returns:
- an identical posting, but which can be manipulated free of this iterator
-
-