ptolemy.graph.sched
Class Schedule.FiringElementIterator

java.lang.Object
  extended by ptolemy.graph.sched.Schedule.FiringElementIterator
All Implemented Interfaces:
java.util.Iterator
Enclosing class:
Schedule

private class Schedule.FiringElementIterator
extends java.lang.Object
implements java.util.Iterator

An adapter class for iterating over the firing elements of this schedule. An exception is thrown if the schedule structure changes while this iterator is active.


Field Summary
private  boolean _advance
           
private  Firing _currentFiring
           
private  java.lang.Object _currentFiringElement
           
private  int _currentIteration
           
private  long _currentVersion
           
private  java.util.Iterator _firingIterator
           
private  boolean _lastHasNext
           
 
Constructor Summary
Schedule.FiringElementIterator()
          Construct a ScheduleIterator.
 
Method Summary
 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

_firingIterator

private java.util.Iterator _firingIterator

_currentFiring

private Firing _currentFiring

_currentFiringElement

private java.lang.Object _currentFiringElement

_currentVersion

private long _currentVersion

_currentIteration

private int _currentIteration

_advance

private boolean _advance

_lastHasNext

private boolean _lastHasNext
Constructor Detail

Schedule.FiringElementIterator

public Schedule.FiringElementIterator()
Construct a ScheduleIterator.

Method Detail

hasNext

public boolean hasNext()
Return true if the iteration has more elements.

Specified by:
hasNext in interface java.util.Iterator
Returns:
True if the iterator has more elements.
Throws:
java.util.ConcurrentModificationException - If the schedule data structure has changed since this iterator was created.

next

public java.lang.Object next()
                      throws java.util.NoSuchElementException
Return the next object in the iteration.

Specified by:
next in interface java.util.Iterator
Returns:
The next object in the iteration.
Throws:
InvalidStateException - If the schedule data structure has changed since this iterator was created.
java.util.NoSuchElementException

remove

public void remove()
Throw an exception, since removal is not allowed. It really doesn't make sense to remove an actor from an actor invocation sequence anyway.

Specified by:
remove in interface java.util.Iterator