|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An object is Iterable
if it has an iterator()
method to
create an Iterator
over its elements.
Some implementations of this interface may allow only one iterator at a
time. For example, BufferedIterator
simply restarts and returns
itself. Iterators received from previous calls to iterator()
will
also restart.
If an object implements this interface, it can be used as a relation in a saffron relational expression. For example,
Iterable iterable = new Iterable() { public Iterator iterator() { ArrayList list = new ArrayList(); list.add(new Integer(1)); list.add(new Integer(2)); return list.iterator(); } }; for (i in (Integer[]) iterable) { print(i.intValue()); }
Method Summary | |
Iterator |
iterator()
Returns an iterator over the elements in this collection. |
Method Detail |
public Iterator iterator()
If this method is called twice on the same object, and the object is not modified in between times, the iterators produced may or may not be the same iterator, and may or may not return the elements in the same order, but must return the same objects.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |