it.unimi.dsi.mg4j.index
Class TermMaps.SynchronizedPrefixMap

java.lang.Object
  extended by it.unimi.dsi.mg4j.index.TermMaps.SynchronizedPrefixMap
All Implemented Interfaces:
PrefixMap, Serializable
Enclosing class:
TermMaps

protected static class TermMaps.SynchronizedPrefixMap
extends Object
implements PrefixMap, Serializable

See Also:
Serialized Form

Field Summary
protected  PrefixMap prefixMap
           
 
Constructor Summary
TermMaps.SynchronizedPrefixMap(PrefixMap prefixMap)
           
 
Method Summary
 Interval getInterval(CharSequence prefix)
          Returns the interval of terms starting with the given prefix.
 CharSequence getPrefix(Interval interval)
          Returns the maximum prefix common to all terms in the given nonempty interval (optional operation).
 MutableString getPrefix(Interval interval, MutableString prefix)
          Writes in the given mutable string the maximum prefix common to all terms in the given nonempty interval (optional operation).
 boolean hasPrefixes()
          Returns true if this prefix map supports prefix retrieval.
 int size()
          Returns the number of terms in this prefix map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prefixMap

protected final PrefixMap prefixMap
Constructor Detail

TermMaps.SynchronizedPrefixMap

public TermMaps.SynchronizedPrefixMap(PrefixMap prefixMap)
Method Detail

getInterval

public Interval getInterval(CharSequence prefix)
Description copied from interface: PrefixMap
Returns the interval of terms starting with the given prefix.

Specified by:
getInterval in interface PrefixMap
Parameters:
prefix - a prefix.
Returns:
the interval of terms starting with prefix (Intervals.EMPTY_INTERVAL in case no term starts with prefix).

getPrefix

public MutableString getPrefix(Interval interval,
                               MutableString prefix)
Description copied from interface: PrefixMap
Writes in the given mutable string the maximum prefix common to all terms in the given nonempty interval (optional operation).

Specified by:
getPrefix in interface PrefixMap
Parameters:
interval - an interval.
prefix - a mutable string that will be filled with the maximum prefix common to all terms in the given nonempty interval.
Returns:
prefix.

getPrefix

public CharSequence getPrefix(Interval interval)
Description copied from interface: PrefixMap
Returns the maximum prefix common to all terms in the given nonempty interval (optional operation).

Specified by:
getPrefix in interface PrefixMap
Parameters:
interval - an interval.
Returns:
the maximum prefix common to all terms in the given nonempty interval.

size

public int size()
Description copied from interface: PrefixMap
Returns the number of terms in this prefix map.

Specified by:
size in interface PrefixMap
Returns:
the number of terms in this prefix map.

hasPrefixes

public boolean hasPrefixes()
Description copied from interface: PrefixMap
Returns true if this prefix map supports prefix retrieval.

Specified by:
hasPrefixes in interface PrefixMap
Returns:
true if this prefix map supports prefix retrieval.