it.unimi.dsi.mg4j.index
Interface TermMap

All Known Implementing Classes:
AbstractTermMap, HashCodeSignedMinimalPerfectHash, ImmutableExternalPrefixDictionary, ImmutableExternalTreePrefixDictionary, ImmutableExternalTriePrefixDictionary, ImmutableTriePrefixTree, LiterallySignedMinimalPerfectHash, MinimalPerfectHash, ShiftAddXorLongSignedMinimalPerfectHash, ShiftAddXorSignedMinimalPerfectHash, SignedMinimalPerfectHash, TermMaps.SynchronizedTermMap, TermMaps.SynchronizedTermPrefixMap, TernaryIntervalSearchTree

Deprecated. As of MG4J 2.1, replaced by StringMap.

@Deprecated
public interface TermMap

A map from terms to numbers (and possibly viceversa).

The possibility of retrieving terms can be checked for by calling hasTerms().

Since:
0.9.2
Author:
Sebastiano Vigna

Method Summary
 int getNumber(CharSequence term)
          Deprecated. Returns the ordinal number corresponding to the given term, or possibly (but not necessarily) -1 if the term was not indexed.
 CharSequence getTerm(int number)
          Deprecated. Returns the term corresponding to the given ordinal number (optional operation).
 MutableString getTerm(int number, MutableString term)
          Deprecated. Writes in the given mutable string the term corresponding to the given ordinal number (optional operation).
 boolean hasTerms()
          Deprecated. Returns true if this prefix map supports term retrieval.
 int size()
          Deprecated. Returns the number of terms in this term map.
 

Method Detail

getNumber

int getNumber(CharSequence term)
Deprecated. 
Returns the ordinal number corresponding to the given term, or possibly (but not necessarily) -1 if the term was not indexed.

We intentionally prefer “ordinal number” to “index” because of the obvious confusion that the latter term can cause.

Parameters:
term - a term.
Returns:
its ordinal number, or possibly (but not necessarily) -1 if the term was not indexed.

hasTerms

boolean hasTerms()
Deprecated. 
Returns true if this prefix map supports term retrieval.

Returns:
true if this prefix map supports term retrieval.

getTerm

CharSequence getTerm(int number)
Deprecated. 
Returns the term corresponding to the given ordinal number (optional operation).

Parameters:
number - a term ordinal number.
Returns:
the corresponding term, or possibly (but not necessarily) null if the term was not indexed.

getTerm

MutableString getTerm(int number,
                      MutableString term)
Deprecated. 
Writes in the given mutable string the term corresponding to the given ordinal number (optional operation).

Parameters:
number - a term ordinal number.
term - a mutable string that will be filled with the corresponding term.
Returns:
term, or possibly (but not necessarily) null if the term was not indexed.

size

int size()
Deprecated. 
Returns the number of terms in this term map.

Returns:
the number of terms in this term map.