edu.cmu.sphinx.decoder.search
Class SimpleActiveListManager

java.lang.Object
  extended by edu.cmu.sphinx.decoder.search.SimpleActiveListManager
All Implemented Interfaces:
ActiveListManager, Configurable

public class SimpleActiveListManager
extends java.lang.Object
implements ActiveListManager

A list of ActiveLists. Different token types are placed in different lists.

This class is not thread safe and should only be used by a single thread.


Field Summary
static java.lang.String PROP_ACTIVE_LIST_FACTORIES
          Sphinx property that defines the name of the active list factory to be used by this search manager.
static java.lang.String PROP_CHECK_PRIOR_LISTS_EMPTY
          This property is used in the Iterator returned by the getNonEmittingListIterator() method.
static boolean PROP_CHECK_PRIOR_LISTS_EMPTY_DEFAULT
          The default value of PROP_CHECK_PRIOR_LISTS_EMPTY.
 
Fields inherited from interface edu.cmu.sphinx.decoder.search.ActiveListManager
PROP_ABSOLUTE_WORD_BEAM_WIDTH, PROP_ABSOLUTE_WORD_BEAM_WIDTH_DEFAULT, PROP_RELATIVE_WORD_BEAM_WIDTH, PROP_RELATIVE_WORD_BEAM_WIDTH_DEFAULT
 
Constructor Summary
SimpleActiveListManager()
           
 
Method Summary
 void add(Token token)
          Adds the given token to the list
 void dump()
          Outputs debugging info for this list manager
 ActiveList getEmittingList()
          Returns the emitting ActiveList, and removes it from this manager.
 java.util.Iterator getNonEmittingListIterator()
          Returns an Iterator of all the non-emitting ActiveLists.
 void newProperties(PropertySheet ps)
          This method is called when this configurable component needs to be reconfigured.
 void replace(Token oldToken, Token newToken)
          Replaces an old token with a new token
 void setNumStateOrder(int numStateOrder)
          Sets the total number of state types to be managed
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_CHECK_PRIOR_LISTS_EMPTY

@S4Boolean(defaultValue=false)
public static final java.lang.String PROP_CHECK_PRIOR_LISTS_EMPTY
This property is used in the Iterator returned by the getNonEmittingListIterator() method. When the Iterator.next() method is called, this property determines whether the lists prior to that returned by next() are empty (they should be empty). If they are not empty, an Error will be thrown.

See Also:
Constant Field Values

PROP_CHECK_PRIOR_LISTS_EMPTY_DEFAULT

public static final boolean PROP_CHECK_PRIOR_LISTS_EMPTY_DEFAULT
The default value of PROP_CHECK_PRIOR_LISTS_EMPTY.

See Also:
Constant Field Values

PROP_ACTIVE_LIST_FACTORIES

@S4ComponentList(type=ActiveListFactory.class)
public static final java.lang.String PROP_ACTIVE_LIST_FACTORIES
Sphinx property that defines the name of the active list factory to be used by this search manager.

See Also:
Constant Field Values
Constructor Detail

SimpleActiveListManager

public SimpleActiveListManager()
Method Detail

newProperties

public void newProperties(PropertySheet ps)
                   throws PropertyException
Description copied from interface: Configurable
This method is called when this configurable component needs to be reconfigured.

Specified by:
newProperties in interface Configurable
Parameters:
ps - a property sheet holding the new data
Throws:
PropertyException - if there is a problem with the properties.

setNumStateOrder

public void setNumStateOrder(int numStateOrder)
Description copied from interface: ActiveListManager
Sets the total number of state types to be managed

Specified by:
setNumStateOrder in interface ActiveListManager
Parameters:
numStateOrder - the total number of state types

add

public void add(Token token)
Adds the given token to the list

Specified by:
add in interface ActiveListManager
Parameters:
token - the token to add

replace

public void replace(Token oldToken,
                    Token newToken)
Replaces an old token with a new token

Specified by:
replace in interface ActiveListManager
Parameters:
oldToken - the token to replace (or null in which case, replace works like add).
newToken - the new token to be placed in the list.

getEmittingList

public ActiveList getEmittingList()
Returns the emitting ActiveList, and removes it from this manager.

Specified by:
getEmittingList in interface ActiveListManager
Returns:
the emitting ActiveList

getNonEmittingListIterator

public java.util.Iterator getNonEmittingListIterator()
Returns an Iterator of all the non-emitting ActiveLists. The iteration order is the same as the search state order.

Specified by:
getNonEmittingListIterator in interface ActiveListManager
Returns:
an Iterator of non-emitting ActiveLists

dump

public void dump()
Outputs debugging info for this list manager

Specified by:
dump in interface ActiveListManager