- All Known Subinterfaces:
ArrayIter
- All Known Implementing Classes:
ArrayListIter
public interface Iter
Iterator interface for more than one return value.
The Java standard
Iterator
interface has some drawbacks:
- the only way to get the current value is to advance the iterator
- the iterator can only point to a single value
- the iterator can only return objects, not primitives
for (Iter iter = ids.iter(); iter.valid(); iter.advance()) {
iter.doSomething();
}
- Author:
- Erich Schubert
-
Method Summary
-
Method Details
-
valid
boolean valid()Returns true if the iterator currently points to a valid object.- Returns:
- a
boolean
value, whether the position is valid.
-
advance
void advance()Moves the iterator forward to the next entry.
-