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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
advance()
Moves the iterator forward to the next entry.void
advance
(int count) Moves the iterator forward or backward by the given offset.get()
Get the current element.int
Get current iterator offset.void
retract()
Moves the iterator backward to the previous entry.void
seek
(int off) Moves the iterator to the given positionboolean
valid()
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:Iter
Returns true if the iterator currently points to a valid object. -
advance
public void advance()Description copied from interface:Iter
Moves the iterator forward to the next entry. -
getOffset
public int getOffset()Description copied from interface:ArrayIter
Get current iterator offset. -
advance
public void advance(int count) Description copied from interface:ArrayIter
Moves the iterator forward or backward by the given offset. -
retract
public void retract()Description copied from interface:ArrayIter
Moves the iterator backward to the previous entry. -
seek
public void seek(int off) Description copied from interface:ArrayIter
Moves the iterator to the given position -
get
Get the current element.- Returns:
- current element
-