public class StringToIntMap
extends java.lang.Object
HashMap.| Constructor and Description |
|---|
StringToIntMap()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(java.lang.String key)
Check if the the argument string is defined as a key in this map.
|
int |
get(java.lang.String key)
Get the value for the key.
|
int |
put(java.lang.String key,
int value)
Add a key-value pair to the map.
|
public boolean containsKey(java.lang.String key)
key - The string to be looked up.true if a value is defined for this string; false else.Map.containsKey(java.lang.Object)public int get(java.lang.String key)
key - The string to be looked up.key, or 0 if key is not
a key in the map. Use containsKey() to find out if
key is actually defined in the map.public int put(java.lang.String key,
int value)
key - The string key.value - The int value.key, if it was set. 0 else.Copyright © 2013. All Rights Reserved.