public class DoubleToIntMap extends ToIntMap
| Modifier and Type | Class and Description |
|---|---|
static class |
DoubleToIntMap.Entry
The class defining the map entries.
|
NOT_FOUND_VALUE| Constructor and Description |
|---|
DoubleToIntMap()
Constructs a new empty map with a default capacity of 11.
|
DoubleToIntMap(DoubleToIntMap map)
Constructs a new map with the same entries as the given map.
|
DoubleToIntMap(int initialCapacity)
Constructs a new empty map with the specified initial capacity
and a default load factor equal to 0.75.
|
DoubleToIntMap(int initialCapacity,
float loadFactor)
Constructs a new empty map with the specified initial capacity and
load factor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
add(double x)
Associates the current size of the map to the given double, and returns this value.
|
boolean |
containsEntry(double key,
int value)
Returns true if this map contains an entry with the specified key and value.
|
boolean |
containsEntry(ToIntMap.Entry candidate)
Returns true if this map contains the specified entry.
|
boolean |
containsKey(double key)
Returns true if this map contains an entry for the specified key.
|
boolean |
equals(java.lang.Object object)
Compares the specified object with this map for equality.
|
int |
get(double key)
Returns the value to which this map maps the specified key.
|
DoubleIterator |
keys()
Returns an iterator through the keys of this map.
|
int |
put(double key,
int value)
Associates the specified value with the specified key in this map.
|
int |
put(ToIntMap.Entry entry)
Puts the mapping defined by the specified entry into this map.
|
int |
remove(double key)
Removes the entry for the given key from this map if present.
|
IntIterator |
values()
Returns an iterator through the values of this map.
|
public DoubleToIntMap()
public DoubleToIntMap(int initialCapacity)
initialCapacity - the initial capacity of the mapjava.lang.IllegalArgumentException - if the initial capacity is negative.public DoubleToIntMap(int initialCapacity,
float loadFactor)
initialCapacity - the initial capacity of the maploadFactor - the load factor of the mapjava.lang.IllegalArgumentException - if either argument is negative.public DoubleToIntMap(DoubleToIntMap map)
map - the DoubleToIntMap whose entries are to be placed in this map.public final boolean containsKey(double key)
key - the key whose presence in this map is to be tested.public final boolean containsEntry(double key,
int value)
key - the keyvalue - the valuepublic final boolean containsEntry(ToIntMap.Entry candidate)
containsEntry in class ToIntMapcandidate - the entry whose presence in this map is to be tested.public final int get(double key)
key - the key whose associated value is to be returned.public final int add(double x)
public final int put(double key,
int value)
key - key with which the specified value is to be associated.value - value to be associated with the specified key.public final int remove(double key)
key - key whose entry is to be removed from the map.public final int put(ToIntMap.Entry entry)
public final DoubleIterator keys()
public final IntIterator values()
public final boolean equals(java.lang.Object object)