org.niffty
Class SymbolPositioner

java.lang.Object
  |
  +--org.niffty.SymbolPositioner

public class SymbolPositioner
extends java.lang.Object


Constructor Summary
SymbolPositioner()
          Creates new SymbolPositioner
 
Method Summary
 void add(Rational startTime, int symbolsToLeft)
          Add a new entry to the positions list for the given startTime, with the given symbolsToLeft.
 int getSymbolCount()
          Return the total symbol count for all the positions, where for each position, there is 1 for the center symbol plus the symbols to left.
 int getSymbolPosition(Rational startTime)
          Get the position of the symbol for the given startTime.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SymbolPositioner

public SymbolPositioner()
Creates new SymbolPositioner

Method Detail

add

public void add(Rational startTime,
                int symbolsToLeft)
Add a new entry to the positions list for the given startTime, with the given symbolsToLeft. If a position already exists for the given startTime, then set its symbols to left value to the max of the existing value and the given symbolsToLeft.


getSymbolCount

public int getSymbolCount()
Return the total symbol count for all the positions, where for each position, there is 1 for the center symbol plus the symbols to left.


getSymbolPosition

public int getSymbolPosition(Rational startTime)
Get the position of the symbol for the given startTime. The position is between 0 and getSymbolCount() and includes all of the previous symbols plus their corresponding symbolsToLeft. If there is no symbol in the symbol position list with the given start time, return -1.