|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jga.algorithms.Flatten
public class Flatten
Algorithms that two-dimensional input, ie, arrays of arrays, collections of collections, etc.
Adapted from a suggestion by Beñat Gurmendi.
Copyright © 2008 David A. Hall
Constructor Summary | |
---|---|
Flatten()
|
Method Summary | ||
---|---|---|
static
|
flatten(java.lang.Iterable<? extends java.lang.Iterable<? extends T>> input)
Returns an Iterable that 'contains' all of the elements of the input(s) |
|
static
|
flatten(java.lang.Iterable<? extends java.lang.Iterable<? extends T>> input,
TCollection cout)
Appends the values of all of the intpu to the output collection |
|
static
|
flatten(java.util.Iterator<? extends java.util.Iterator<? extends T>> input)
Returns an Iterator that will return elements from all of the iterators |
|
static
|
flatten(T[][] ts)
Returns all elements of the 2d array |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Flatten()
Method Detail |
---|
public static <T> java.lang.Iterable<T> flatten(T[][] ts)
public static <T> java.lang.Iterable<T> flatten(java.lang.Iterable<? extends java.lang.Iterable<? extends T>> input)
public static <T> java.util.Iterator<T> flatten(java.util.Iterator<? extends java.util.Iterator<? extends T>> input)
public static <T,TCollection extends java.util.Collection<? super T>> TCollection flatten(java.lang.Iterable<? extends java.lang.Iterable<? extends T>> input, TCollection cout)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |