|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jutil.java.collections.ObjectArrayIterator
A class of iterators for multi-dimensional arrays of objects. The traversal of the array is depth-first. You can, but should not use this class in your code. Using the Visitor class is a better way of visiting all elements of a multi-dimensional array.
Field Summary | |
static java.lang.String |
CVS_REVISION
|
Constructor Summary | |
ObjectArrayIterator(java.lang.Object[] array)
// The array of an ObjectArrayIterator is not null. public invariant getArray() != null; // pre array != null; // The array of this ObjectArrayIterator will be set to post getArray() == array; // The iterator will be positioned at the start of the array. post atStart() == true; Initialize a new ObjectArrayIterator with the given array of objects |
Method Summary | |
boolean |
atEnd()
Check whether this iterator is positioned at the end of its array Result True if this iterator is positioned at the end of its array, false otherwise. |
boolean |
atStart()
Check whether this iterator is positioned at the beginning of its array Result True if this iterator is positioned at the beginning of its array, false otherwise. |
java.lang.Object[] |
getArray()
Return the array of this ObjectArrayIterator. |
java.lang.Object |
getElement()
Return the element of the array at the current position of the iterator. |
void |
next()
Go to the next element of the array Effects If the iterator wasn't at the end of the array, the iterator will be positioned at the next element. |
void |
previous()
Go to the previous element of the array Effects If the iterator wasn't at the start of the array, the iterator will be positioned at the previous element. |
void |
setElement(java.lang.Object element)
Set the element of the array at the current position of the iterator to the given element. |
void |
toEnd()
Set this iterator to the end of the array. |
void |
toStart()
Set this iterator to the beginning of the array. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CVS_REVISION
Constructor Detail |
public ObjectArrayIterator(java.lang.Object[] array) throws ZeroDimensionException
array
- an array of objectsMethod Detail |
public boolean atStart()
public java.lang.Object[] getArray()
public boolean atEnd()
public void next() throws java.util.NoSuchElementException
public void previous() throws java.util.NoSuchElementException
public void toStart()
public void toEnd()
public java.lang.Object getElement()
public void setElement(java.lang.Object element)
element
- the new element that will be placed
at the current position.
Effects
The element of the array at the current
position of the iterator will be set to
the given element.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |