|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfi.iki.juri.collections.JIterTools
public class JIterTools
| Constructor Summary | |
|---|---|
JIterTools()
|
|
| Method Summary | ||
|---|---|---|
static
|
enumerate(java.lang.Iterable<T> iterable)
An Iterable-based version of enumerate(Iterator). |
|
static
|
enumerate(java.lang.Iterable<T> iterable,
int start)
An Iterable-based version of enumerate(Iterator, int). |
|
static
|
enumerate(java.util.Iterator<T> iterator)
Transforms the Iterator (a b c d ...) to ((0 a) (1 b) (2 c) (3 d) ...). |
|
static
|
enumerate(java.util.Iterator<T> iterator,
int start)
Transforms the Iterator (a b c d ...) to ((start a) (start+1 b) (start+2
c) (start+3 d) ...). |
|
static
|
zip(java.util.Collection<java.lang.Iterable<T>> iterables)
Iterable-based counterpart to zip(Collection). |
|
static
|
zip(java.util.Collection<java.util.Iterator<T>> iterators)
Zip up multiple iterators. |
|
static
|
zip(java.lang.Iterable<T>... iterables)
Iterable-based counterpart to zip(Iterator...). |
|
static
|
zip(java.util.Iterator<T>... iterators)
Vararg-based version of zip(Collection) |
|
static
|
zipFill(java.util.Collection<IterableAndFiller<T>> iterables)
|
|
static
|
zipFill(java.util.Collection<IteratorAndFiller<T>> itfillers)
Zip up multiple Iterators. |
|
static
|
zipFill(IteratorAndFiller<T>... itfillers)
|
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JIterTools()
| Method Detail |
|---|
public static <T> java.util.Iterator<java.util.Collection<T>> zip(java.util.Collection<java.util.Iterator<T>> iterators)
Iteratorss reports it has no more items.
iterators - the Iterators to zip up
Iterator of Collections, where the nth item in the mth
Collection is the mth item in the nth Iterator passed in as a
parameter.public static <T> java.util.Iterator<java.util.Collection<T>> zip(java.util.Iterator<T>... iterators)
zip(Collection)
public static <T> java.lang.Iterable<java.util.Collection<T>> zip(java.util.Collection<java.lang.Iterable<T>> iterables)
Iterable-based counterpart to zip(Collection).
public static <T> java.lang.Iterable<java.util.Collection<T>> zip(java.lang.Iterable<T>... iterables)
Iterable-based counterpart to zip(Iterator...).
public static <T> java.util.Iterator<java.util.Collection<T>> zipFill(java.util.Collection<IteratorAndFiller<T>> itfillers)
Iterators. ((a b c) (d e f)) becomes ((a d) (b e) (c f)).
Stops when all of the Iterators report they have no more items. Uses the
function passed in the IteratorAndFiller object to
acquire filler data for an exhausted Iterator.
itfillers - the Iterators to zip up and the corresponding filler functions
Iterator of Collections, where the nth item in the mth
Collection is the mth item in the nth Iterator passed in as a
parameter or the result of calling the corresponding FillerFunctionpublic static <T> java.util.Iterator<java.util.Collection<T>> zipFill(IteratorAndFiller<T>... itfillers)
zipFill(Collection)public static <T> java.lang.Iterable<java.util.Collection<T>> zipFill(java.util.Collection<IterableAndFiller<T>> iterables)
public static <T> java.util.Iterator<EnumeratedItem<T>> enumerate(java.util.Iterator<T> iterator)
Iterator (a b c d ...) to ((0 a) (1 b) (2 c) (3 d) ...).
iterator - the objects whose contents should be enumerated.
if you want to specify the
starting index.
public static <T> java.util.Iterator<EnumeratedItem<T>> enumerate(java.util.Iterator<T> iterator,
int start)
Iterator (a b c d ...) to ((start a) (start+1 b) (start+2
c) (start+3 d) ...).
T - iterator - the objects whose contents should be enumerated.start - the number to start the enumeration with.
public static <T> java.lang.Iterable<EnumeratedItem<T>> enumerate(java.lang.Iterable<T> iterable)
Iterable-based version of enumerate(Iterator).
public static <T> java.lang.Iterable<EnumeratedItem<T>> enumerate(java.lang.Iterable<T> iterable,
int start)
Iterable-based version of enumerate(Iterator, int).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||