DthingApi
|
Classes | |
class | SimpleEntry |
class | SimpleImmutableEntry |
Public Member Functions | |
void | clear () |
boolean | containsKey (Object key) |
boolean | containsValue (Object value) |
abstract Set< Map.Entry< K, V > > | entrySet () |
boolean | equals (Object object) |
V | get (Object key) |
int | hashCode () |
boolean | isEmpty () |
Set< K > | keySet () |
V | put (K key, V value) |
void | putAll (Map<? extends K, ? extends V > map) |
V | remove (Object key) |
int | size () |
String | toString () |
Collection< V > | values () |
![]() | |
void | putAll (Map<? extends K,? extends V > map) |
Protected Member Functions | |
Object | clone () throws CloneNotSupportedException |
A base class for
implementations.
Subclasses that permit new mappings to be added must override put.
The default implementations of many methods are inefficient for large maps. For example in the default implementation, each call to get performs a linear iteration of the entry set. Subclasses should override such methods to improve their performance.
|
inline |
Removes all elements from this
, leaving it empty.
UnsupportedOperationException | if removing elements from this Map |
This implementation calls
.
Implements java.util.Map< K, V >.
|
inline |
Returns whether this
contains the specified key.
key | the key to search for. |
This implementation iterates its key set, looking for a key that
equals.
Implements java.util.Map< K, V >.
|
inline |
Returns whether this
contains the specified value.
value | the value to search for. |
This implementation iterates its entry set, looking for an entry with a value that
equals.
Implements java.util.Map< K, V >.
|
abstract |
Returns a
containing all of the mappings in this
. Each mapping is an instance of Map.Entry. As the
is backed by this
, changes in one will be reflected in the other.
Implements java.util.Map< K, V >.
|
inline |
Compares the argument to the receiver, and returns
if the specified object is a
and both
s contain the same mappings.
object | the Object Object |
This implementation first checks the structure of
. If it is not a map or of a different size, this returns false. Otherwise it iterates its own entry set, looking up each entry's key in
. If any value does not equal the other map's value for the same key, this returns false. Otherwise it returns true.
Implements java.util.Map< K, V >.
|
inline |
Returns the value of the mapping with the specified key.
key | the key. |
This implementation iterates its entry set, looking for an entry with a key that
equals.
Implements java.util.Map< K, V >.
|
inline |
Returns an integer hash code for the receiver.
s which are equal return the same value for this method.
This implementation iterates its entry set, summing the hashcodes of its entries.
Implements java.util.Map< K, V >.
|
inline |
Returns whether this map is empty.
This implementation compares
to 0.
Implements java.util.Map< K, V >.
|
inline |
Returns a set of the keys contained in this
. The
is backed by this
so changes to one are reflected by the other. The
does not support adding.
This implementation returns a view that calls through this to map. Its iterator transforms this map's entry set iterator to return keys.
Implements java.util.Map< K, V >.
|
inline |
Maps the specified key to the specified value.
key | the key. |
value | the value. |
UnsupportedOperationException | if adding to this Map |
ClassCastException | if the class of the key or value is inappropriate for this Map |
IllegalArgumentException | if the key or value cannot be added to this Map |
NullPointerException | if the key or value is null Map null |
This base implementation throws
.
Implements java.util.Map< K, V >.
|
inline |
|
inline |
Removes a mapping with the specified key from this
.
key | the key of the mapping to remove. |
UnsupportedOperationException | if removing from this Map |
This implementation iterates its entry set, removing the entry with a key that
equals.
Implements java.util.Map< K, V >.
|
inline |
Returns the number of mappings in this
.
This implementation returns its entry set's size.
Implements java.util.Map< K, V >.
|
inline |
This implementation composes a string by iterating its entry set. If this map contains itself as a key or a value, the string "(this Map)" will appear in its place.
|
inline |
Returns a
of the values contained in this
. The
is backed by this
so changes to one are reflected by the other. The
supports Collection#remove, Collection#removeAll, Collection#retainAll, and Collection#clear operations, and it does not support Collection#add or Collection#addAll operations. This method returns a
which is the subclass of AbstractCollection. The AbstractCollection#iterator method of this subclass returns a "wrapper object" over the iterator of this
's entrySet(). The AbstractCollection#size method wraps this
's size method and the AbstractCollection#contains method wraps this
's containsValue method. The collection is created when this method is called at first time and returned in response to all subsequent calls. This method may return different Collection when multiple calls to this method, since it has no synchronization performed.
This implementation returns a view that calls through this to map. Its iterator transforms this map's entry set iterator to return values.
Implements java.util.Map< K, V >.