Class InstantiatedTerm
- java.lang.Object
-
- org.apache.lucene.store.instantiated.InstantiatedTerm
-
- All Implemented Interfaces:
Serializable
public class InstantiatedTerm extends Object implements Serializable
A term in the inverted index, coupled to the documents it occurs in.- See Also:
Term, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static Comparator<InstantiatedTerm>comparatorstatic Comparator<Object>termComparator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intbinarySearchAssociatedDocuments(int target)intbinarySearchAssociatedDocuments(int target, int offset)intbinarySearchAssociatedDocuments(int target, int offset, int length)Stringfield()InstantiatedTermDocumentInformationgetAssociatedDocument(int documentNumber)Navigates to the view of this occurrences of this term in a specific document.InstantiatedTermDocumentInformation[]getAssociatedDocuments()Meta data per document in which this term is occurring.TermgetTerm()intgetTermIndex()intseekCeilingDocumentInformationIndex(int target)Finds index to the first beyond the current whose document number is greater than or equal to target, -1 if there is no such element.intseekCeilingDocumentInformationIndex(int target, int startOffset)Finds index to the first beyond the current whose document number is greater than or equal to target, -1 if there is no such element.intseekCeilingDocumentInformationIndex(int target, int startOffset, int endPosition)Finds index to the first beyond the current whose document number is greater than or equal to target, -1 if there is no such element.voidsetTermIndex(int termIndex)Stringtext()StringtoString()
-
-
-
Field Detail
-
comparator
public static final Comparator<InstantiatedTerm> comparator
-
termComparator
public static final Comparator<Object> termComparator
-
-
Method Detail
-
getTerm
public Term getTerm()
- Returns:
- Term associated with this entry of the index object graph
-
getAssociatedDocuments
public InstantiatedTermDocumentInformation[] getAssociatedDocuments()
Meta data per document in which this term is occurring. Ordered by document number.- Returns:
- Meta data per document in which this term is occurring.
-
seekCeilingDocumentInformationIndex
public int seekCeilingDocumentInformationIndex(int target)
Finds index to the first beyond the current whose document number is greater than or equal to target, -1 if there is no such element.- Parameters:
target- the document number to match- Returns:
- -1 if there is no such element
-
seekCeilingDocumentInformationIndex
public int seekCeilingDocumentInformationIndex(int target, int startOffset)Finds index to the first beyond the current whose document number is greater than or equal to target, -1 if there is no such element.- Parameters:
target- the document number to matchstartOffset- associated documents index start offset- Returns:
- -1 if there is no such element
-
seekCeilingDocumentInformationIndex
public int seekCeilingDocumentInformationIndex(int target, int startOffset, int endPosition)Finds index to the first beyond the current whose document number is greater than or equal to target, -1 if there is no such element.- Parameters:
target- the document number to matchstartOffset- associated documents index start offsetendPosition- associated documents index end position- Returns:
- -1 if there is no such element
-
binarySearchAssociatedDocuments
public int binarySearchAssociatedDocuments(int target)
-
binarySearchAssociatedDocuments
public int binarySearchAssociatedDocuments(int target, int offset)
-
binarySearchAssociatedDocuments
public int binarySearchAssociatedDocuments(int target, int offset, int length)- Parameters:
target- value to search for in the arrayoffset- index of the first valid value in the arraylength- number of valid values in the array- Returns:
- index of an occurrence of key in array, or -(insertionIndex + 1) if key is not contained in array (insertionIndex is then the index at which key could be inserted).
-
getAssociatedDocument
public InstantiatedTermDocumentInformation getAssociatedDocument(int documentNumber)
Navigates to the view of this occurrences of this term in a specific document. This method is only used by InstantiatedIndex(IndexReader) and should not be optimized for less CPU at the cost of more RAM.- Parameters:
documentNumber- the n:th document in the index- Returns:
- view of this term from specified document
-
field
public final String field()
-
text
public final String text()
-
getTermIndex
public int getTermIndex()
-
setTermIndex
public void setTermIndex(int termIndex)
-
-