hmi.elckerlyc.planunit
Class PlanUnitTimeManager

java.lang.Object
  extended by hmi.elckerlyc.planunit.PlanUnitTimeManager

public class PlanUnitTimeManager
extends Object


Field Summary
private  KeyPositionManager kpManager
           
private static org.slf4j.Logger logger
           
private  Map<KeyPosition,TimePeg> pegs
           
 
Constructor Summary
PlanUnitTimeManager(KeyPositionManager kpm)
           
 
Method Summary
 List<String> getAvailableSyncs()
           
 double getEndTime()
           
 KeyPosition getKeyPosition(TimePeg sp)
          Gets the keyposition associated with sp
 double getNextPegTime(String pid)
          Get the time of the next set timepeg after the timepeg linked to this keyposition
 Map<KeyPosition,TimePeg> getPegs()
           
 double getPegTime(String pid)
           
 double getPrevPegTime(String pid)
          Get the time of the first set timepeg before the timepeg linked to this keyposition
 double getRelativeTime(double absoluteTime)
          Get relative time (0..1) using a linear timewarp between the two keypositions that most closely match absolute time
 double getRelativeTime(String syncId)
           
 double getStartTime()
           
 TimePeg getTimePeg(String pid)
           
 boolean hasValidTiming()
           
 void setPegs(Map<KeyPosition,TimePeg> pegs)
           
 void setTimePeg(KeyPosition kp, TimePeg sp)
           
 void setTimePeg(String kid, TimePeg sp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pegs

private Map<KeyPosition,TimePeg> pegs

kpManager

private final KeyPositionManager kpManager

logger

private static final org.slf4j.Logger logger
Constructor Detail

PlanUnitTimeManager

public PlanUnitTimeManager(KeyPositionManager kpm)
Method Detail

setPegs

public void setPegs(Map<KeyPosition,TimePeg> pegs)

getRelativeTime

public double getRelativeTime(String syncId)
                       throws RelativeSyncNotFoundException
Throws:
RelativeSyncNotFoundException

getPegs

public Map<KeyPosition,TimePeg> getPegs()
Returns:
the synchs

hasValidTiming

public boolean hasValidTiming()

getKeyPosition

public KeyPosition getKeyPosition(TimePeg sp)
Gets the keyposition associated with sp

Parameters:
sp -
Returns:

getPrevPegTime

public double getPrevPegTime(String pid)
Get the time of the first set timepeg before the timepeg linked to this keyposition

Parameters:
pid - id of the keyposition
Returns:
the time of the first set timepeg before the timepeg linked to this keyposition, TimePeg.VALUE_UNKNOWN if none set or pid unknown

getNextPegTime

public double getNextPegTime(String pid)
Get the time of the next set timepeg after the timepeg linked to this keyposition

Parameters:
pid - id of the keyposition
Returns:
the time of the next set timepeg after the timepeg linked to this keyposition, TimePeg.VALUE_UNKNOWN if none set

getPegTime

public double getPegTime(String pid)

getTimePeg

public TimePeg getTimePeg(String pid)

getStartTime

public double getStartTime()

getEndTime

public double getEndTime()

setTimePeg

public void setTimePeg(KeyPosition kp,
                       TimePeg sp)

setTimePeg

public void setTimePeg(String kid,
                       TimePeg sp)

getRelativeTime

public double getRelativeTime(double absoluteTime)
Get relative time (0..1) using a linear timewarp between the two keypositions that most closely match absolute time


getAvailableSyncs

public List<String> getAvailableSyncs()