Package org.terrier.structures.postings
Class ArrayOfBasicIterablePosting
- java.lang.Object
-
- org.terrier.structures.postings.IterablePostingImpl
-
- org.terrier.structures.postings.ArrayOfIdsIterablePosting
-
- org.terrier.structures.postings.ArrayOfBasicIterablePosting
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Cloneable
,IterablePosting
,Posting
- Direct Known Subclasses:
ArrayOfBlockIterablePosting
,ArrayOfFieldIterablePosting
public class ArrayOfBasicIterablePosting extends ArrayOfIdsIterablePosting
An instance of IterablePostings that works with passed arrays of ids and frequencies- Author:
- Craig Macdonald
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]
doclens
protected int[]
frequencies
frequencies of all of the stored postings-
Fields inherited from class org.terrier.structures.postings.ArrayOfIdsIterablePosting
id, ids, indice
-
Fields inherited from interface org.terrier.structures.postings.IterablePosting
END_OF_LIST, EOL
-
-
Constructor Summary
Constructors Constructor Description ArrayOfBasicIterablePosting(int[] _ids, int[] _freqs)
Make a new posting list with these ids and frequenciesArrayOfBasicIterablePosting(int[] _ids, int[] _freqs, int[] _lens)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDocumentLength()
Return the length of the document of the current posting in tokens.int
getFrequency()
Return the frequency of the term in the current document, in tokens.-
Methods inherited from class org.terrier.structures.postings.ArrayOfIdsIterablePosting
asWritablePosting, clone, close, endOfPostings, getId, next, reset
-
Methods inherited from class org.terrier.structures.postings.IterablePostingImpl
next
-
-
-
-
Method Detail
-
getFrequency
public int getFrequency()
Return the frequency of the term in the current document, in tokens.- Specified by:
getFrequency
in interfacePosting
- Overrides:
getFrequency
in classArrayOfIdsIterablePosting
- Returns:
- frequency of the term in the current document, in tokens.
-
getDocumentLength
public int getDocumentLength()
Description copied from class:ArrayOfIdsIterablePosting
Return the length of the document of the current posting in tokens. Usually uses the DocumentIndex, may do otherwise if document length statistics are in posting list. Returns 0.- Specified by:
getDocumentLength
in interfacePosting
- Overrides:
getDocumentLength
in classArrayOfIdsIterablePosting
- Returns:
- length of the document of the current posting in tokens.
-
-