SyncBaseConditionpublic final class SyncBaseCondition extends TimeCondition implements TimeDependent, IDRefAn SyncBaseCondition generates a TimeInstance
everytime the SyncBase TimedElementSupport generates a new
interval (i.e., each time its newInterval method is
called by the TypedElement . A SyncBaseCondition
is a time dependent of it's sync base TimedElementSupport |
Fields Summary |
---|
String | syncBaseIdThe SyncBase identifier | TimedElementSupport | syncBaseSyncBase TimedElementSupport | boolean | isBeginSyncTrue if this condition is on the syncBase's begin. | long | offsetOffset from the synch base |
Constructors Summary |
---|
public SyncBaseCondition(TimedElementNode timedElementNode, boolean isBegin, String syncBaseId, boolean isBeginSync, long offset)
super(timedElementNode.timedElementSupport, isBegin);
if (syncBaseId == null) {
throw new NullPointerException();
}
this.syncBaseId = syncBaseId;
this.isBeginSync = isBeginSync;
this.offset = offset;
timedElementNode.ownerDocument.resolveIDRef(this, syncBaseId);
|
Methods Summary |
---|
public void | onNewInterval(TimedElementSupport syncBase)Called by the associated sync base when it creates a new
current TimeInterval . Whenever this happens, a
new IntervalTimeInstance is added for the sync base's begin or end
interval time (depending on isBeginSync), to the timedElement's
begin or end instance list (depending on isBegin).
// IntervalTimeInstances are _not_ cleared on reset
new IntervalTimeInstance(timedElement, syncBase,
offset, false, isBegin, isBeginSync);
| public void | resolveTo(ElementNode ref)IDRef implementation.
if (!(ref instanceof TimedElementNode)) {
// The condition is synchronized on an element which does
// not have timing. Do nothing, this is _not_ an error.
return;
}
syncBase = ((TimedElementNode) ref).timedElementSupport;
if (isBeginSync) {
if (syncBase.beginDependents == null) {
syncBase.beginDependents = new Vector(1);
}
syncBase.beginDependents.addElement(this);
} else {
if (syncBase.endDependents == null) {
syncBase.endDependents = new Vector(1);
}
syncBase.endDependents.addElement(this);
}
| protected java.lang.String | toStringTrait()Converts this SyncBaseCondition to a String trait.
StringBuffer sb = new StringBuffer();
sb.append(syncBaseId);
sb.append('.");
if (isBeginSync) {
sb.append("begin");
} else {
sb.append("end");
}
if (offset != 0) {
if (offset > 0) {
sb.append('+");
}
sb.append(offset / 1000f);
sb.append('s");
}
return sb.toString();
|
|