objectdraw
Class DrawableIterator

java.lang.Object
  extended by objectdraw.DrawableIterator

public class DrawableIterator
extends Object

A DrawableIterator is a list of DrawableInterface objects that you can read through one by one in order. It is used to report a list of objects on a canvas. The typical usage looks like this:

DrawableIterator iter = canvas.getDrawableIterator();
while(iter.hasNext()) {
   DrawableInterface d = iter.next();
   // do something with d
}

Author:
Russell Zahniser (russell@zahniser.net)
See Also:
DrawingCanvas.getDrawableIterator()

Constructor Summary
protected DrawableIterator(ArrayList drawables)
           
 
Method Summary
 boolean hasNext()
          Return true if there are more objects left to be read from this iterator, false if it is at the end of its list.
 DrawableInterface next()
          Retrieve the next DrawableInterface object from this iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawableIterator

protected DrawableIterator(ArrayList drawables)
Method Detail

hasNext

public boolean hasNext()
Return true if there are more objects left to be read from this iterator, false if it is at the end of its list.

Returns:
whether this iterator has more drawables remaining to be read

next

public DrawableInterface next()
Retrieve the next DrawableInterface object from this iterator.

Returns:
the next DrawableInterface object from this iterator.
Throws:
IndexOutOfBoundsException - if there are no more drawables to be retrieved.