hmi.elckerlyc
Class PegBoard

java.lang.Object
  extended by hmi.elckerlyc.PegBoard

@ThreadSafe
public final class PegBoard
extends Object

Keeps track of TimePegs and BMLBlockPegs

Author:
Herwin van Welbergen

Nested Class Summary
private static class PegBoard.PegKey
           
 
Field Summary
private  ConcurrentHashMap<String,BMLBlockPeg> bmlBlockPegs
           
private  org.slf4j.Logger logger
           
private  ConcurrentHashMap<PegBoard.PegKey,TimePeg> pegs
           
 
Constructor Summary
PegBoard()
           
 
Method Summary
 void addBMLBlockPeg(BMLBlockPeg p)
           
 void addTimePeg(String syncId, String id, String bmlId, TimePeg p)
          Adds p to the pegboard.
 void addTimePegs(List<SyncAndTimePeg> satps)
           
 void clear()
          Removes all bmlBlockPegs and pegs from the board
 BMLBlockPeg getBMLBlockPeg(String bmlId)
          Get the block peg associated with the bml block, null for non-existing
 double getPegTime(String syncId, String id, String bmlId)
           
 double getRelativePegTime(String bmlTargetId, String syncId, String id, String bmlId)
          Get the timing of the peg identified by (syncId, id, bmlId), relative to bmlTargetId
 double getRelativePegTime(String bmlTargetId, TimePeg p)
          Get the timing of the peg relative to bmlTargetId
 Set<String> getTimedSyncs(String id, String bmlId)
          Get the syncs of behavior id that have a TimePeg value !
 TimePeg getTimePeg(String syncId, String id, String bmlId)
           
 void removeBehaviour(String id, String bmlId)
          Remove all links to TimePegs corresponding with the behavior bmlId:id
 void setBMLBlockTime(String bmlId, double time)
          Sets the time for a BMLBlock on the board
 void setPegTime(String syncId, String id, String bmlId, double time)
          Sets the time for a TimePeg on the board
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pegs

private final ConcurrentHashMap<PegBoard.PegKey,TimePeg> pegs

bmlBlockPegs

private final ConcurrentHashMap<String,BMLBlockPeg> bmlBlockPegs

logger

private org.slf4j.Logger logger
Constructor Detail

PegBoard

public PegBoard()
Method Detail

clear

public void clear()
Removes all bmlBlockPegs and pegs from the board


addBMLBlockPeg

public void addBMLBlockPeg(BMLBlockPeg p)

getBMLBlockPeg

public BMLBlockPeg getBMLBlockPeg(String bmlId)
Get the block peg associated with the bml block, null for non-existing


getRelativePegTime

public double getRelativePegTime(String bmlTargetId,
                                 TimePeg p)
Get the timing of the peg relative to bmlTargetId


getRelativePegTime

public double getRelativePegTime(String bmlTargetId,
                                 String syncId,
                                 String id,
                                 String bmlId)
Get the timing of the peg identified by (syncId, id, bmlId), relative to bmlTargetId


getPegTime

public double getPegTime(String syncId,
                         String id,
                         String bmlId)

setPegTime

public void setPegTime(String syncId,
                       String id,
                       String bmlId,
                       double time)
Sets the time for a TimePeg on the board


setBMLBlockTime

public void setBMLBlockTime(String bmlId,
                            double time)
Sets the time for a BMLBlock on the board


addTimePegs

public void addTimePegs(List<SyncAndTimePeg> satps)

addTimePeg

public void addTimePeg(String syncId,
                       String id,
                       String bmlId,
                       TimePeg p)
Adds p to the pegboard.


getTimePeg

public TimePeg getTimePeg(String syncId,
                          String id,
                          String bmlId)

getTimedSyncs

public Set<String> getTimedSyncs(String id,
                                 String bmlId)
Get the syncs of behavior id that have a TimePeg value != TimePeg.ValueUnknown


removeBehaviour

public void removeBehaviour(String id,
                            String bmlId)
Remove all links to TimePegs corresponding with the behavior bmlId:id