|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
E - the element type for the values to which the keys are mappedpublic interface DoubleKeyMap<E>
This is a Map that maps doubles (keys) to Objects
(values). If the key is given as a Double rather than a
double, it must not be null. Values are
allowed to be null.
The idea behind this interface is that the use of doubles as
keys (rather than Double objects) should allow for more
efficient (time and memory) implementations of this interface.
| Nested Class Summary | |
|---|---|
static interface |
DoubleKeyMap.DoubleKeyEntry<E>
A node in the Map. |
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| Method Summary | |
|---|---|
boolean |
containsKey(double key)
This function returns true if this DoubleKeyMap contains a mapping for the specified key, which is a double here. |
E |
get(double key)
This function returns the value to which this DoubleKeyMap maps the specified key, which is a double here. |
E |
put(double key,
E value)
This function associates the specified key, a double, with the specified value in this DoubleKeyMap. |
E |
remove(double key)
This function removes the mapping for this key, a double, from this DoubleKeyMap if it was present. |
| Methods inherited from interface java.util.Map |
|---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
| Method Detail |
|---|
E put(double key,
E value)
This function associates the specified key, a double, with the specified
value in this DoubleKeyMap. If the DoubleKeyMap previously contained a
mapping for this key, the old value is replaced. The old value is also
used as the return value of this function. A null return may indicate
that no previous association existed or that the DoubleKeyMap previously
associated null with the specified key (see get(double)).
key - the key with which the specified value is to be associatedvalue - the value to be associated with the specified key
boolean containsKey(double key)
This function returns true if this DoubleKeyMap contains a mapping for the specified key, which is a double here.
key - the key whose presence in this DoubleKeyMap is to be tested
E get(double key)
This function returns the value to which this DoubleKeyMap maps the
specified key, which is a double here. It returns null if the
DoubleKeyMap contains no mapping for this key. A return value of null
does not necessarily indicate that the DoubleKeyMap contains no
mapping for the key; it is also possible that the DoubleKeyMap explicitly
maps the key to null. The containsKey(double) operation may be
used to distinguish these two cases.
key - key whose associated value is to be returned
E remove(double key)
This function removes the mapping for this key, a double, from this
DoubleKeyMap if it was present. The value the key was mapped to is
returned. A null return may indicate that the DoubleKeyMap previously
associated null with the specified key (see get(double)).
key - the key to the mapping that is to be removed
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||