it.unimi.dsi.mg4j.index
Class AbstractTermMap

java.lang.Object
  extended byit.unimi.dsi.mg4j.index.AbstractTermMap
All Implemented Interfaces:
TermMap
Direct Known Subclasses:
MinimalPerfectHash

public abstract class AbstractTermMap
extends Object
implements TermMap

An abstract implementation of a map from term to term indices.

Subclasses need just to implement get(int) (and, of course, TermMap.get(CharSequence)).

Since:
0.9
Author:
Sebastiano Vigna

Constructor Summary
AbstractTermMap()
           
 
Method Summary
 CharSequence get(int index)
          Returns the term corresponding to the given index (optional operation).
 MutableString get(int index, MutableString term)
          Writes in the given mutable string the term corresponding to the given index (optional operation).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.mg4j.index.TermMap
get
 

Constructor Detail

AbstractTermMap

public AbstractTermMap()
Method Detail

get

public CharSequence get(int index)
Description copied from interface: TermMap
Returns the term corresponding to the given index (optional operation).

Specified by:
get in interface TermMap
Parameters:
index - a term index.
Returns:
the corresponding term, or possibly (but not necessarily) null if the term was not indexed.

get

public MutableString get(int index,
                         MutableString term)
Description copied from interface: TermMap
Writes in the given mutable string the term corresponding to the given index (optional operation).

Specified by:
get in interface TermMap
Parameters:
index - a term index.
term - a mutable string that will be fillted with the corresponding term.
Returns:
term, or possibly (but not necessarily) null if the term was not indexed.