|
APCS Java Subset | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectap.java.util.TreeMap
| Constructor Summary | |
TreeMap()
|
|
| Method Summary | |
boolean |
containsKey(java.lang.Object key)
Returns true if there is a value associated
with key in this map, otherwise returns
false. |
java.lang.Object |
get(java.lang.Object key)
Return the value associated with key in this
map, or null if there is no value associated
wit key. |
Set |
keySet()
Returns a Set of the keys in the maps. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
Associates value with key in
this map so that get(key) returns
value. |
java.lang.Object |
remove(java.lang.Object key)
Removes the mapping for this key from the map and returns the value previously associated with the key in the map. |
int |
size()
Return the number of keys in this map, which is the same as the number of (key,value) pairs. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TreeMap()
| Method Detail |
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
Mapvalue with key in
this map so that get(key) returns
value. If key was mapped to
a different value, the previous mapping is replaced.
put in interface Mapkey - is what is mapped to/associated with
valuevalue - is what key is mapped to
key
or null if there was no previous mapping.public java.lang.Object get(java.lang.Object key)
Mapkey in this
map, or null if there is no value associated
wit key.
get in interface Mapkey - is the key whose associated value is returned
key
or null if there is no such value.public boolean containsKey(java.lang.Object key)
Maptrue if there is a value associated
with key in this map, otherwise returns
false.
containsKey in interface Mapkey - is the key for which the map is queried as to
the existence of an associated value
true if there is a (key,value) pair in the map for
the specified key, otherwise return falsepublic int size()
Map
size in interface Mappublic Set keySet()
MapSet of the keys in the maps.
Removing a key from the associated set, e.g., via an iterator,
removes it from the map as well. The terminology for this
is that the set is backed by the map
keySet in interface Mappublic java.lang.Object remove(java.lang.Object key)
Mapnull is
returned.
remove in interface Mapkey - is the key whose mapping is to be removed
key
or null if there was no previous mapping.
|
unofficial documentation for the APCS Java Subset | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||