edu.cmu.sphinx.decoder.search
Class ArrayTokenStack

java.lang.Object
  extended byedu.cmu.sphinx.decoder.search.ArrayTokenStack
All Implemented Interfaces:
TokenStack

public class ArrayTokenStack
extends java.lang.Object
implements TokenStack

An array implementation of TokenStack.


Constructor Summary
ArrayTokenStack(int capacity)
          Constructs a ArrayTokenStack object with the given capacity.
 
Method Summary
 Token add(Token newToken)
          Adds the given Token to this TokenStack.
 void clear()
          Removes all of the Tokens from this TokenStack
 int getCapacity()
          Returns the capacity of this TokenStack, that is, the maximum number of elements allowed in this TokenStack.
 boolean isInsertable(float score, int frameNumber)
          Returns true if the given score is higher than the lowest scoring token in this TokenStack.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayTokenStack

public ArrayTokenStack(int capacity)
Constructs a ArrayTokenStack object with the given capacity.

Parameters:
capacity - the height of the stack
Method Detail

add

public Token add(Token newToken)
Adds the given Token to this TokenStack.

Specified by:
add in interface TokenStack
Parameters:
newToken - the new Token to add
Returns:
the replaced Token, or null if no Token was replaced

isInsertable

public boolean isInsertable(float score,
                            int frameNumber)
Returns true if the given score is higher than the lowest scoring token in this TokenStack.

Specified by:
isInsertable in interface TokenStack
Parameters:
score - the score the check
Returns:
true if the given score is higher than the lowest scoring token, false otherwise

getCapacity

public int getCapacity()
Returns the capacity of this TokenStack, that is, the maximum number of elements allowed in this TokenStack.

Specified by:
getCapacity in interface TokenStack
Returns:
the capacity of this TokenStack

clear

public void clear()
Removes all of the Tokens from this TokenStack

Specified by:
clear in interface TokenStack