Methods Summary |
---|
void | addDependent(IntervalTimeInstance timeInstance)Adds a new IntervalTimeInstance dependent.
If timeInstance synchronizes on begin, it is
added to the beginDependent list. Otherwise,
it is added to the endDependent list.
Vector dependents = beginDependents;
if (!timeInstance.isBeginSync) {
dependents = endDependents;
}
if (dependents == null) {
dependents = new Vector(1);
if (timeInstance.isBeginSync) {
beginDependents = dependents;
} else {
endDependents = dependents;
}
}
dependents.addElement(timeInstance);
|
void | prune()Called when the interval is pruned from a timed element. The result is
that all dependent time instances should be removed from their respective
instance lists.
int n = beginDependents != null ? beginDependents.size() : 0;
for (int i = n - 1; i >= 0; i--) {
IntervalTimeInstance iti =
(IntervalTimeInstance) beginDependents.elementAt(i);
iti.timedElement.removeTimeInstance(iti);
iti.dispose();
}
n = endDependents != null ? endDependents.size() : 0;
for (int i = n - 1; i >= 0; i--) {
IntervalTimeInstance iti =
(IntervalTimeInstance) endDependents.elementAt(i);
iti.timedElement.removeTimeInstance(iti);
iti.dispose();
}
|
void | removeDependent(IntervalTimeInstance timeInstance)Removes the input IntervalTimeInstance dependent.
Vector dependents = beginDependents;
if (!timeInstance.isBeginSync) {
dependents = endDependents;
}
if (dependents == null) {
return;
}
dependents.removeElement(timeInstance);
|
void | setBegin(Time newBegin)Updates the begin time. Note that an unresolved begin time is
illegal. Trying to set one will cause an exception to be thrown
(an IllegalArgumentException).
Dependent end conditions are notified of begin time change.
if (!newBegin.isResolved()) {
throw new IllegalArgumentException("" + newBegin);
}
this.begin = newBegin;
if (beginDependents != null) {
int n = beginDependents.size();
for (int i = 0; i < n; i++) {
((IntervalTimeInstance) beginDependents.elementAt(i))
.onIntervalUpdate();
}
}
|
void | setEnd(Time newEnd)Updates the end time. Dependent end conditions are notified
of the end time change. A
if (newEnd == null) {
throw new NullPointerException();
}
this.end = newEnd;
if (endDependents != null) {
int n = endDependents.size();
for (int i = 0; i < n; i++) {
((IntervalTimeInstance) endDependents.elementAt(i))
.onIntervalUpdate();
}
}
|