ptolemy.actor.sched
Class Schedule.ActorIterator

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

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

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


Field Summary
private  boolean _advance
           
private  Actor _currentActor
           
private  Firing _currentFiring
           
private  int _currentIteration
           
private  long _currentVersion
           
private  java.util.Iterator _firingIterator
           
private  boolean _lastHasNext
           
 
Constructor Summary
Schedule.ActorIterator()
          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

_currentActor

private Actor _currentActor

_currentVersion

private long _currentVersion

_currentIteration

private int _currentIteration

_advance

private boolean _advance

_lastHasNext

private boolean _lastHasNext
Constructor Detail

Schedule.ActorIterator

public Schedule.ActorIterator()
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