org.webmacro.util
Class ArrayIterator

java.lang.Object
  extended byorg.webmacro.util.ArrayIterator
All Implemented Interfaces:
java.util.Iterator

public final class ArrayIterator
extends java.lang.Object
implements java.util.Iterator

This provides an iterator interface to an array


Constructor Summary
ArrayIterator(java.lang.Object[] array)
          Construct an iterator given an enumeration
 
Method Summary
 boolean hasNext()
          Return true if we have not yet reached the end of the enumeration
static void main(java.lang.String[] arg)
          Test harness
 java.lang.Object next()
          Advance the iterator and return the next value.
 void remove()
          Unsupported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayIterator

public ArrayIterator(java.lang.Object[] array)
Construct an iterator given an enumeration

Method Detail

hasNext

public final boolean hasNext()
Return true if we have not yet reached the end of the enumeration

Specified by:
hasNext in interface java.util.Iterator

next

public final java.lang.Object next()
                            throws java.util.NoSuchElementException
Advance the iterator and return the next value. Return null if we reach the end of the enumeration.

Specified by:
next in interface java.util.Iterator
Throws:
java.util.NoSuchElementException

remove

public final void remove()
                  throws java.lang.UnsupportedOperationException
Unsupported

Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException

main

public static void main(java.lang.String[] arg)
Test harness