edu.cmu.sphinx.linguist.acoustic.tiedstate
Class Pool

java.lang.Object
  extended byedu.cmu.sphinx.linguist.acoustic.tiedstate.Pool

public class Pool
extends java.lang.Object

Used to pool shared objects in the acoustic model


Constructor Summary
Pool(java.lang.String name)
          Creates a new pool
 
Method Summary
 java.lang.Object get(int id)
          returns the object with the given ID from the pool
 int getFeature(java.lang.String name, int defaultValue)
          Retrieves a feature from this pool
 java.lang.String getName()
          returns the pool's name.
 int indexOf(java.lang.Object object)
          returns the ID of a given object from the pool
 void logInfo(java.util.logging.Logger logger)
          Dump information on this pool to the given logger
 void put(int id, java.lang.Object o)
          Places the given object in the pool
 void setFeature(java.lang.String name, int value)
          Sets a feature for this pool
 int size()
          Retrieves the size of the pool
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pool

public Pool(java.lang.String name)
Creates a new pool

Parameters:
name - the name of the pool
Method Detail

getName

public java.lang.String getName()
returns the pool's name.

Returns:
the pool name

get

public java.lang.Object get(int id)
returns the object with the given ID from the pool

Parameters:
id - the id of the object
Returns:
the object
Throws:
java.lang.IndexOutOfBoundsException - if the ID is out of range

indexOf

public int indexOf(java.lang.Object object)
returns the ID of a given object from the pool

Parameters:
object - the object
Returns:
the index

put

public void put(int id,
                java.lang.Object o)
Places the given object in the pool

Parameters:
id - a unique ID for this object
o - the object to add to the pool

size

public int size()
Retrieves the size of the pool

Returns:
the size of the pool

logInfo

public void logInfo(java.util.logging.Logger logger)
Dump information on this pool to the given logger

Parameters:
logger - the logger to send the info to

setFeature

public void setFeature(java.lang.String name,
                       int value)
Sets a feature for this pool

Parameters:
name - the name of the feature
value - the value for the feature

getFeature

public int getFeature(java.lang.String name,
                      int defaultValue)
Retrieves a feature from this pool

Parameters:
name - the name of the feature
defaultValue - the defaultValue for the pool
Returns:
the value for the feature