|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectptolemy.graph.sched.Schedule.FiringIterator
private class Schedule.FiringIterator
An adapter class for iterating over the firings of this schedule. An exception is thrown if the schedule structure changes while this iterator is active. The iterator walks the schedule tree as the hasNext() and next() methods are invoked, using a small number of state variables.
| Field Summary | |
|---|---|
private boolean |
_advance
|
private int |
_currentDepth
|
private ScheduleElement |
_currentNode
|
private int[] |
_horizontalNodePosition
|
private int[] |
_iterationCounts
|
private boolean |
_lastHasNext
|
private long |
_startingVersion
|
| Constructor Summary | |
|---|---|
Schedule.FiringIterator(Schedule schedule)
Construct a ScheduleIterator. |
|
| Method Summary | |
|---|---|
private Schedule |
_backTrack(ScheduleElement firingNode)
Start at the specified node in the schedule tree and move up the tree (towards the root node) until we find a node the has children we have not iterated through yet or children that we have not iterated through enough times (not reached the maximum iteration count). |
private ScheduleElement |
_findLeafNode(Schedule node)
Start at the specified node and move down the tree (away from the root node) until we find the next Firing in the iteration order. |
boolean |
hasNext()
Return true if the iteration has more elements. |
java.lang.Object |
next()
Return the next object in the iteration. |
void |
remove()
Throw an exception, since removal is not allowed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private boolean _advance
private ScheduleElement _currentNode
private boolean _lastHasNext
private int _currentDepth
private long _startingVersion
private int[] _iterationCounts
private int[] _horizontalNodePosition
| Constructor Detail |
|---|
public Schedule.FiringIterator(Schedule schedule)
| Method Detail |
|---|
public boolean hasNext()
hasNext in interface java.util.Iteratorjava.util.ConcurrentModificationException - If the schedule
data structure has changed since this iterator was created.
InternalErrorException - If the schedule contains
any leaf nodes that are not an instance of Firing.
public java.lang.Object next()
throws java.util.NoSuchElementException
next in interface java.util.IteratorInvalidStateException - If the schedule
data structure has changed since this iterator was created.
java.util.NoSuchElementExceptionpublic void remove()
remove in interface java.util.Iteratorprivate Schedule _backTrack(ScheduleElement firingNode)
firingNode - The starting node to backtrack from.private ScheduleElement _findLeafNode(Schedule node)
node - The schedule node to start from.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||