ptolemy.actor.sched
Class Firing.ActorIterator

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

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

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


Field Summary
private  int _currentElement
           
private  int _iterationCount
           
private  long _startingVersion
           
 
Constructor Summary
Firing.ActorIterator(int iterationCount)
          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

_startingVersion

private long _startingVersion

_currentElement

private int _currentElement

_iterationCount

private int _iterationCount
Constructor Detail

Firing.ActorIterator

public Firing.ActorIterator(int iterationCount)
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