Package it.unimi.dsi.big.util
Class StringMaps
- java.lang.Object
-
- it.unimi.dsi.big.util.StringMaps
-
public class StringMaps extends java.lang.Object
A class providing static methods and objects that do useful things with string maps and prefix maps.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
StringMaps.PrefixMapWrapper<T extends java.lang.CharSequence>
protected static class
StringMaps.StringMapWrapper<T extends java.lang.CharSequence>
protected static class
StringMaps.SynchronizedPrefixMap<S extends java.lang.CharSequence>
protected static class
StringMaps.SynchronizedStringMap<S extends java.lang.CharSequence>
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends java.lang.CharSequence>
PrefixMap<T>synchronize(PrefixMap<T> prefixMap)
Returns a synchronized prefix map backed by the given prefix map.static <T extends java.lang.CharSequence>
StringMap<T>synchronize(StringMap<T> stringMap)
Returns a synchronized string map backed by the given string map.static <T extends java.lang.CharSequence>
PrefixMap<T>wrap(PrefixMap<T> prefixMap)
static <T extends java.lang.CharSequence>
StringMap<T>wrap(StringMap<T> stringMap)
-
-
-
Method Detail
-
synchronize
public static <T extends java.lang.CharSequence> StringMap<T> synchronize(StringMap<T> stringMap)
Returns a synchronized string map backed by the given string map.- Parameters:
stringMap
- the string map to be wrapped in a synchronized map.- Returns:
- a synchronized view of the specified string map.
-
synchronize
public static <T extends java.lang.CharSequence> PrefixMap<T> synchronize(PrefixMap<T> prefixMap)
Returns a synchronized prefix map backed by the given prefix map.- Parameters:
prefixMap
- the prefix map to be wrapped in a synchronized map.- Returns:
- a synchronized view of the specified prefix map.
-
wrap
public static <T extends java.lang.CharSequence> StringMap<T> wrap(StringMap<T> stringMap)
- Parameters:
stringMap
- a string map.- Returns:
- a
StringMap
view ofstringMap
.
-
wrap
public static <T extends java.lang.CharSequence> PrefixMap<T> wrap(PrefixMap<T> prefixMap)
Returns an immutable (big)PrefixMap
view of a standardPrefixMap
. Note that the returned prefix map does not implementPrefixMap.prefixMap()
.- Parameters:
prefixMap
- a prefix map.- Returns:
- a
PrefixMap
view ofprefixMap
.
-
-