org.apache.lucene.store.instantiated
Class InstantiatedTerm

java.lang.Object
  extended by 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
static Comparator<InstantiatedTerm> comparator
           
static Comparator termComparator
           
 
Method Summary
 int binarySearchAssociatedDocuments(int target)
           
 int binarySearchAssociatedDocuments(int target, int offset)
           
 int binarySearchAssociatedDocuments(int target, int offset, int length)
           
 String field()
           
 InstantiatedTermDocumentInformation getAssociatedDocument(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.
 org.apache.lucene.index.Term getTerm()
           
 int getTermIndex()
           
 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.
 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.
 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.
 void setTermIndex(int termIndex)
           
 String text()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

comparator

public static final Comparator<InstantiatedTerm> comparator

termComparator

public static final Comparator termComparator
Method Detail

getTerm

public org.apache.lucene.index.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 match
startOffset - 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 match
startOffset - associated documents index start offset
endPosition - 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 array
offset - index of the first valid value in the array
length - 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()

toString

public String toString()
Overrides:
toString in class Object

getTermIndex

public int getTermIndex()

setTermIndex

public void setTermIndex(int termIndex)


Copyright © 2000-2010 Apache Software Foundation. All Rights Reserved.