public final class Numbered<T> extends DelegatingIterable<Pair<java.lang.Integer,T>>
Iterable decorator which pairs every value of another iterator with it's sequential ordinal number.
Example:
Iterable<String> strings = new Seq<>("a", "b", "c");
for (Pair<Integer, String> item:new Numbered<>(strings))
{
System.out.println(String.format("%d: %s", item.left(), item.right());
}
results in
0: a 1: b 2: c
| Constructor and Description |
|---|
Numbered(java.lang.Iterable<T> delegate) |
Numbered(java.lang.Iterable<T> delegate,
int start) |
Numbered(java.lang.Iterable<T> delegate,
int start,
int step) |
iterator