Java Reference
In-Depth Information
Useful Methods of Iterator Objects
Method
Description
Returns true if there are more elements to be examined
hasNext()
Returns the next element from the list and advances the position of the
iterator by one
next()
Removes the element most recently returned by next()
remove()
Useful Methods of Map Objects
Method
Description
Removes all keys and values from a map
clear()
Returns true if the given key maps to some value in this map
containsKey(key)
Returns true if some key maps to the given value in this map
containsValue(value)
Returns the value associated with this key, or null if not found
get(key)
Returns true if this collection contains no keys or values
isEmpty()
Returns a Set of all keys in this map
keySet()
Associates the given key with the given value
put(key, value)
Adds all key/value mappings from the given map to this map
putAll(map)
Removes the given key and its associated value from this map
remove(key)
Returns the number of key/value mappings in this map
size()
Returns a Collection of all values in this map
values()
 
 
Search WWH ::




Custom Search