Package org.apache.uima.internal.util
Class StringToIntMap
- java.lang.Object
-
- org.apache.uima.internal.util.StringToIntMap
-
public class StringToIntMap extends java.lang.ObjectStraightforward, many-to-one map from Strings to ints, based on a JavaHashMap.
-
-
Constructor Summary
Constructors Constructor Description StringToIntMap()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsKey(java.lang.String key)Check if the the argument string is defined as a key in this map.intget(java.lang.String key)Get the value for the key.intput(java.lang.String key, int value)Add a key-value pair to the map.
-
-
-
Method Detail
-
containsKey
public boolean containsKey(java.lang.String key)
Check if the the argument string is defined as a key in this map.- Parameters:
key- The string to be looked up.- Returns:
trueif a value is defined for this string;falseelse.- See Also:
Map.containsKey(java.lang.Object)
-
get
public int get(java.lang.String key)
Get the value for the key.- Parameters:
key- The string to be looked up.- Returns:
- The int value for
key, or0ifkeyis not a key in the map. UsecontainsKey()to find out ifkeyis actually defined in the map.
-
put
public int put(java.lang.String key, int value)Add a key-value pair to the map.- Parameters:
key- The string key.value- The int value.- Returns:
- The previous value of
key, if it was set.0else.
-
-