csli.util.classify.berkeley
Class FeatureMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.TreeMap<Double,Double>
          extended by csli.util.classify.berkeley.FeatureMap
All Implemented Interfaces:
Serializable, Cloneable, Map<Double,Double>, NavigableMap<Double,Double>, SortedMap<Double,Double>

public class FeatureMap
extends TreeMap<Double,Double>

A TreeMap extension for feature data - an indexed vector of values for a single feature. Keys are Objects (intended to be times or utterance start times). Values are Objects (intended to be the corresponding values for this feature). As it's a TreeMap, keys will be returned in ascending order, which is what we want when writing out to file.

Author:
mpurver
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
FeatureMap()
          Initialise as an empty hash
FeatureMap(File inputFile)
          Initialise from an input feature data file
 
Method Summary
 double get(double key)
          Convenient interface to TreeMap for small-d doubles
 void loadFile(File file)
          (Re-)Initialise from an input feature data file
 void put(double key, double value)
          Convenient interface to TreeMap for small-d doubles
 void toFile(File file)
          Write feature data out to a feature data file
 
Methods inherited from class java.util.TreeMap
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, size, subMap, subMap, tailMap, tailMap, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, isEmpty, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode, isEmpty
 

Constructor Detail

FeatureMap

public FeatureMap()
Initialise as an empty hash


FeatureMap

public FeatureMap(File inputFile)
Initialise from an input feature data file

Parameters:
inputFile - the input feature data file
Method Detail

loadFile

public void loadFile(File file)
(Re-)Initialise from an input feature data file

Parameters:
file - the input feature data file

toFile

public void toFile(File file)
Write feature data out to a feature data file

Parameters:
file - the output feature data file

get

public double get(double key)
Convenient interface to TreeMap for small-d doubles

Parameters:
key -
Returns:
value

put

public void put(double key,
                double value)
Convenient interface to TreeMap for small-d doubles

Parameters:
key -
value -