gov.sandia.cognition.collection
Interface NumericMap<KeyType>

Type Parameters:
KeyType - The type of the key in the map.
All Known Subinterfaces:
DataDistribution<DataType>, DataDistribution.PMF<KeyType>, InfiniteVector<KeyType>, ScalarMap<KeyType>
All Known Implementing Classes:
AbstractDataDistribution, AbstractMutableDoubleMap, AbstractScalarMap, DataCountTreeSetBinnedMapHistogram, DefaultDataDistribution, DefaultDataDistribution.PMF, DefaultInfiniteVector, ScalarDataDistribution, ScalarDataDistribution.CDF, ScalarDataDistribution.PMF

public interface NumericMap<KeyType>

An interface for a mapping of keys to numeric values.

Since:
3.3.1
Author:
Justin Basilico

Method Summary
 void clear()
          Removes all elements from the map.
 boolean containsKey(KeyType key)
          Determines if this map contains the given key.
 KeyType getMaxValueKey()
          Gets the non-unique key associated with the maximum value in the map.
 Set<KeyType> getMaxValueKeys()
          Gets a set of all keys associated with the maximum value in the map.
 KeyType getMinValueKey()
          Gets the non-unique key associated with the minimum value in the map.
 Set<KeyType> getMinValueKeys()
          Gets a set of all keys associated with the minimum value in the map.
 boolean isEmpty()
          Returns true if the map is empty.
 Set<KeyType> keySet()
          Gets the set of unique keys in the map.
 int size()
          Gets the number of items in the map.
 

Method Detail

isEmpty

boolean isEmpty()
Returns true if the map is empty.

Returns:
True if the map is empty, which means the size is 0.

keySet

Set<KeyType> keySet()
Gets the set of unique keys in the map.

Returns:
The set of unique keys in the map.

containsKey

boolean containsKey(KeyType key)
Determines if this map contains the given key.

Parameters:
key - A key.
Returns:
True if the map contains the key; otherwise false.

size

int size()
Gets the number of items in the map. This is equal to the number of unique keys.

Returns:
The number of items in the map. Must be positive.

clear

void clear()
Removes all elements from the map.


getMaxValueKey

KeyType getMaxValueKey()
Gets the non-unique key associated with the maximum value in the map. There can be several keys returning the maximum and this method returns one of them. If the map is empty, it returns null.

Returns:
Non-unique key associated with the maximum value in the map.

getMaxValueKeys

Set<KeyType> getMaxValueKeys()
Gets a set of all keys associated with the maximum value in the map.

Returns:
Set of all keys associated with the maximum value in the map.

getMinValueKey

KeyType getMinValueKey()
Gets the non-unique key associated with the minimum value in the map. There can be several keys returning the minimum and this method returns one of them. If the map is empty, it returns null.

Returns:
Non-unique key associated with the minimum value in the map.

getMinValueKeys

Set<KeyType> getMinValueKeys()
Gets a set of all keys associated with the minimum value in the map.

Returns:
Set of all keys associated with the minimum value in the map.