|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.collections.ArrayIterator
public class ArrayIterator
Iterates through items in an array. Implements both java.util.Iterator and
the DFC Cursor
iterator interface.
Constructor Summary | |
---|---|
ArrayIterator(Object[] items)
Create a new instance. |
|
ArrayIterator(Object[] items,
int index)
Create a new instance. |
Method Summary | |
---|---|
Object |
current()
|
boolean |
hasNext()
|
boolean |
inside()
|
int |
move(int units)
Move the cursor left (negative units) or right (positive units). |
Object |
next()
|
void |
remove()
Not supported. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArrayIterator(Object[] items)
items
- The items to iterate.public ArrayIterator(Object[] items, int index)
items
- The items to iterate.index
- The start index. May be "outside" the sequence (null iteration).Method Detail |
---|
public boolean inside()
inside
in interface Cursor
public Object current() throws NoSuchElementException
current
in interface Cursor
NoSuchElementException
- If the cursor is not inside the collection.public int move(int units)
Cursor
move
in interface Cursor
units
- The number of units to move.
public boolean hasNext()
hasNext
in interface Iterator
public Object next()
next
in interface Iterator
public void remove()
remove
in interface Iterator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |