|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.jutil.java.collections.ArrayCursor
A class of objects that point to a certain index in a multi-dimensional array.
| Class Specifications |
|
public invariant getDimensions() != null; public invariant ( \forall int i; i >= 0&&i < getDimensions().length; getDimensions()[i] > 0); public invariant getDimensions().equals(Arrays.getArrayDimensions(array)); public invariant getCursor() != null; public invariant getCursor().length == getDimensions().length; public invariant ( \forall int i; i >= 0&&i < getCursor().length; (getCursor()[i] >= 0)&&(getCursor()[i] < getDimensions()[i])); |
| Model Field Summary | |
java.lang.Object[] |
array
|
| Field Summary | |
static java.lang.String |
CVS_REVISION
|
| Constructor Summary | |
ArrayCursor(java.lang.Object[] theArray)
Initialize a new ArrayCursor for a given array of objects. |
|
| Method Summary | |
boolean |
atEnd()
Check whether this cursor points to the end of the array. |
boolean |
atStart()
Check whether this cursor points to the beginning of the array. |
int[] |
getCursor()
Return the index this ArrayCursor is pointing at. |
int[] |
getDimensions()
Return the dimensions of the array of this cursor. |
int |
getNbDimensions()
Return the number of dimensions of the array |
void |
next()
Set this cursor to the next element in the array. |
void |
previous()
Set this cursor to the previous element in the array. |
void |
toEnd()
Set this ArrayCursor to the end of the array. |
void |
toStart()
Set this ArrayCursor to the beginning of the array. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Model Field Detail |
public java.lang.Object[] array
| Field Detail |
public static final java.lang.String CVS_REVISION
| Constructor Detail |
public ArrayCursor(java.lang.Object[] theArray)
throws ZeroDimensionException
| Method Detail |
public int getNbDimensions()
public int[] getDimensions()
public int[] getCursor()
public boolean atStart()
public boolean atEnd()
public void next()
throws java.util.NoSuchElementException
public void previous()
throws java.util.NoSuchElementException
public void toStart()
public void toEnd()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||