|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MapID
Map from ints to doubles.
| Nested Class Summary | |
|---|---|
static interface |
MapID.Entry
A map entry (key-value pair) for MapIF. |
| Field Summary | |
|---|---|
static double |
DEFAULT_VALUE
|
| Method Summary | |
|---|---|
void |
clear()
Removes all of the mappings from this map. |
boolean |
containsKey(int key)
Returns true if this map contains a mapping for the specified key. |
boolean |
containsValue(double value)
Returns true if this map contains one or more mappings with the specified value. |
Set<MapID.Entry> |
entrySet()
Returns a Set view of the mappings contained in this map. |
boolean |
equals(Object o)
Compares the specified object with this map for equality. |
double |
get(int key)
Returns the value to which the specified key is mapped, or throws NoSuchElementException if this map contains no mapping for the key. |
int |
hashCode()
Returns the hash code value for this map. |
boolean |
isEmpty()
Returns true if this map contains no key-value mappings. |
Set<Integer> |
keySet()
Returns a Set view of the keys contained in this map. |
double |
put(int key,
double value)
Associates the specified value with the specified key in this map. |
void |
putAll(MapID m)
Copies all of the mappings from the specified map to this map. |
double |
remove(int key)
Removes the mapping for a key from this map if it is present. |
int |
size()
Returns the number of key-value mappings in this map. |
Collection<Double> |
values()
Returns a Collection view of the values contained in this map. |
| Field Detail |
|---|
static final double DEFAULT_VALUE
| Method Detail |
|---|
int size()
boolean isEmpty()
boolean containsKey(int key)
key - key whose presence in this map is to be tested
boolean containsValue(double value)
value - value whose presence in this map is to be tested
double get(int key)
NoSuchElementException if this map contains no mapping for the key.
key - the key whose associated value is to be returned
NoSuchElementException - if the key is not contained in this map
double put(int key,
double value)
key - key with which the specified value is to be associatedvalue - value to be associated with the specified keydouble remove(int key)
key - key whose mapping is to be removed from the mapvoid putAll(MapID m)
m - mappings to be stored in this mapvoid clear()
Set<Integer> keySet()
Set view of the keys contained in this map. Note that this is a inefficient
operation since it triggers autoboxing of the int keys, which is exactly what this
implementation is trying to avoid. Unlike a standard Java Map, values in the backing
map cannot be altered with this collection view.
Collection<Double> values()
Collection view of the values contained in this map. Note that this is a
inefficient operation since it triggers autoboxing of the double values, which is exactly what
this implementation is trying to avoid. Unlike a standard Java Map, values in the
backing map cannot be altered with this collection view.
Set<MapID.Entry> entrySet()
Set view of the mappings contained in this map. The set is backed by the map,
so changes to the map are reflected in the set, and vice-versa.
boolean equals(Object o)
equals in class Objecto - object to be compared for equality with this map
int hashCode()
Object.hashCode().
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||