KeyType
- Type of key in the Mappublic class AbstractMutableDoubleMap<KeyType> extends AbstractScalarMap<KeyType,MutableDouble>
Modifier and Type | Class and Description |
---|---|
static interface |
AbstractMutableDoubleMap.Entry<KeyType>
Interface for entries.
|
protected static class |
AbstractMutableDoubleMap.SimpleEntry<KeyType>
Entry for the AbstractScalarMap
|
protected static class |
AbstractMutableDoubleMap.SimpleEntrySet<KeyType>
Simple Entry Set for DefaultInfiniteVector
|
protected static class |
AbstractMutableDoubleMap.SimpleIterator<KeyType>
Simple iterator for DefaultInfiniteVector
|
map
Constructor and Description |
---|
AbstractMutableDoubleMap(java.util.Map<KeyType,MutableDouble> map)
Creates a new instance of AbstractMutableDoubleMap
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<KeyType,MutableDouble> |
asMap()
Gets a
java.util.Map that contains the same data as in this
scalar map. |
AbstractMutableDoubleMap<KeyType> |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
void |
compact()
Removes entries from the map with value of 0.0
|
java.util.Set<AbstractMutableDoubleMap.Entry<KeyType>> |
entrySet()
Gets the set of entries in this scalar map.
|
double |
get(KeyType key)
Gets the value associated with a given key.
|
double |
increment(KeyType key,
double value)
Increments the value associated with the given key by the given amount.
|
void |
set(KeyType key,
double value)
Sets the value associated with a given key.
|
clear, containsKey, decrement, decrement, decrementAll, decrementAll, getMaxValue, getMaxValueKey, getMaxValueKeys, getMinValue, getMinValueKey, getMinValueKeys, increment, incrementAll, incrementAll, isEmpty, keySet, setAll, setAll, size
public AbstractMutableDoubleMap(java.util.Map<KeyType,MutableDouble> map)
map
- The backing map that the data is stored in.public AbstractMutableDoubleMap<KeyType> clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface CloneableSerializable
clone
in class AbstractScalarMap<KeyType,MutableDouble>
public java.util.Map<KeyType,MutableDouble> asMap()
ScalarMap
java.util.Map
that contains the same data as in this
scalar map.asMap
in interface ScalarMap<KeyType>
asMap
in class AbstractScalarMap<KeyType,MutableDouble>
Map
version of this data structure.public void compact()
public double get(KeyType key)
ScalarMap
key
- A key.public void set(KeyType key, double value)
ScalarMap
key
- A key.value
- The value to associate with the key.public double increment(KeyType key, double value)
ScalarMap
increment
in interface ScalarMap<KeyType>
increment
in class AbstractScalarMap<KeyType,MutableDouble>
key
- A key.value
- The amount to increment the value associated with the given key by.public java.util.Set<AbstractMutableDoubleMap.Entry<KeyType>> entrySet()
ScalarMap