java.lang.Object
de.lmu.ifi.dbs.elki.utilities.datastructures.iterator.ArrayListIter<O>
- Type Parameters:
O- contained object type.
ELKI style Iterator for array lists.
Note: this implementation is only efficient for lists with efficient random
access and seeking (i.e. ArrayLists, but not Linked Lists!)
- Author:
- Erich Schubert
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadvance()Moves the iterator forward to the next entry.voidadvance(int count) Moves the iterator forward or backward by the given offset.get()Get the current element.intGet current iterator offset.voidretract()Moves the iterator backward to the previous entry.voidseek(int off) Moves the iterator to the given positionbooleanvalid()Returns true if the iterator currently points to a valid object.
-
Constructor Details
-
ArrayListIter
Constructor.- Parameters:
data- Data array.
-
-
Method Details
-
valid
public boolean valid()Description copied from interface:IterReturns true if the iterator currently points to a valid object. -
advance
public void advance()Description copied from interface:IterMoves the iterator forward to the next entry. -
getOffset
public int getOffset()Description copied from interface:ArrayIterGet current iterator offset. -
advance
public void advance(int count) Description copied from interface:ArrayIterMoves the iterator forward or backward by the given offset. -
retract
public void retract()Description copied from interface:ArrayIterMoves the iterator backward to the previous entry. -
seek
public void seek(int off) Description copied from interface:ArrayIterMoves the iterator to the given position -
get
Get the current element.- Returns:
- current element
-