edu.indiana.iucbrf.feature.finiteset
Class KeyToValueToDouble

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap
          extended by edu.indiana.iucbrf.feature.finiteset.KeyToValueToDouble
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map

public class KeyToValueToDouble
extends java.util.HashMap

This class represents a map from FeatureKey to a HashMap, which in turn maps from FSMFeature attribute value (String) to a MutableDouble.

See Also:
Serialized Form

Constructor Summary
KeyToValueToDouble(FeatureSpecCollection fsc)
           
 
Method Summary
static java.util.HashMap constructValueSetToDoubleMap(java.util.HashSet valueSet)
          Prepare a HashMap from members of a valueSet to a MutableDouble with value 0.
 double getDouble(FeatureKey key, java.lang.String value)
          Returns double associated with the value of an attribute.
 java.util.HashMap getDoubles(FeatureKey key)
          Returns a map from attribute value (String) to MutableDouble.
protected  MutableDouble getMutableDouble(FeatureKey key, java.lang.String value)
           
 void incrementDouble(FeatureKey key, java.lang.String value)
          Increments the MutableDouble associated with the value of an attribute.
 void reinitDoubles()
          Reinitialize the MutableDouble associated with the attribute values, to handle a new list of cases.
 java.lang.String toString()
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

KeyToValueToDouble

public KeyToValueToDouble(FeatureSpecCollection fsc)
Method Detail

constructValueSetToDoubleMap

public static java.util.HashMap constructValueSetToDoubleMap(java.util.HashSet valueSet)
Prepare a HashMap from members of a valueSet to a MutableDouble with value 0.


getDoubles

public java.util.HashMap getDoubles(FeatureKey key)
Returns a map from attribute value (String) to MutableDouble.


getDouble

public double getDouble(FeatureKey key,
                        java.lang.String value)
Returns double associated with the value of an attribute.


incrementDouble

public void incrementDouble(FeatureKey key,
                            java.lang.String value)
Increments the MutableDouble associated with the value of an attribute.


reinitDoubles

public void reinitDoubles()
Reinitialize the MutableDouble associated with the attribute values, to handle a new list of cases.


getMutableDouble

protected MutableDouble getMutableDouble(FeatureKey key,
                                         java.lang.String value)

toString

public java.lang.String toString()
Overrides:
toString in class java.util.AbstractMap