org.pf.util
Class ObjectArrayIterator

java.lang.Object
  extended by org.pf.util.ObjectArrayIterator
All Implemented Interfaces:
java.util.Iterator

public class ObjectArrayIterator
extends java.lang.Object
implements java.util.Iterator

Provides iteration over object arrays (i.e. Object[]).

Version:
1.0
Author:
M.Duchrow

Constructor Summary
ObjectArrayIterator(java.lang.Object[] objects)
          Initialize the new instance with default values.
 
Method Summary
 boolean hasNext()
          Returns true if the iteration has more elements.
 java.lang.Object next()
          Returns the next element in the iteration.
 void remove()
          Remove is actually not supported.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectArrayIterator

public ObjectArrayIterator(java.lang.Object[] objects)
Initialize the new instance with default values.

Method Detail

hasNext

public boolean hasNext()
Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Specified by:
hasNext in interface java.util.Iterator
Returns:
true if the iterator has more elements.

next

public java.lang.Object next()
Returns the next element in the iteration.

Specified by:
next in interface java.util.Iterator
Returns:
the next element in the iteration.
Throws:
java.util.NoSuchElementException - iteration has no more elements.

remove

public void remove()
Remove is actually not supported. It is not reasonable anyway on an immutable object array.
So nothing happens here.

Specified by:
remove in interface java.util.Iterator