|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.Ostermiller.util.ArrayIterator<ElementType>
ElementType
- Type of array over which to iteratepublic class ArrayIterator<ElementType>
Converts an array to an iterator.
More information about this class is available from ostermiller.org.
Constructor Summary | |
---|---|
ArrayIterator(ElementType[] array)
Create an Iterator from an Array. |
Method Summary | |
---|---|
boolean |
hasNext()
Tests if this Iterator contains more elements. |
ElementType |
next()
Returns the next element of this Iterator if this Iterator object has at least one more element to provide. |
void |
remove()
Removes the last object from the array by setting the slot in the array to null. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArrayIterator(ElementType[] array)
array
- of objects on which to enumerate.Method Detail |
---|
public boolean hasNext()
hasNext
in interface java.util.Iterator<ElementType>
public ElementType next() throws java.util.NoSuchElementException
next
in interface java.util.Iterator<ElementType>
java.util.NoSuchElementException
- if no more elements exist.public void remove()
remove
in interface java.util.Iterator<ElementType>
java.lang.IllegalStateException
- if the next method has not yet been called, or the remove method has already been called after the last call to the next method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |