|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jga.algorithms.Merge
public class Merge
Algorithms that combine the contents of two inputs. The inputs may arrays, collections, or iterations. The append methods that appear here are historical -- the original implementation of append was a Merge where the functor was constant TRUE (always choosing the contents of the first input until it is exhausted). Now, the append methods delegate to the Append class, but due to backwards compatability (and a desire to shield the user from "unchecked" warnings caused by the use of a varargs array of generic types in the Append signatures), these methods will remain to support the most common use-case.
Copyright © 2006 David A. Hall
Nested Class Summary | |
---|---|
static class |
Merge.MergeIterable<T>
Produces iterators that return all of the merged contents of two inputs |
static class |
Merge.MergeIterator<T>
Iterator that merges the contents of two input iterators. |
Constructor Summary | |
---|---|
Merge()
|
Method Summary | ||
---|---|---|
static
|
append(java.lang.Iterable<? extends T> input0,
java.lang.Iterable<? extends T> input1)
Returns an Iterable implementation that 'contains' all elements of first iterable followed by all elements of the second iterable |
|
static
|
append(java.lang.Iterable<? extends T> cin1,
java.lang.Iterable<? extends T> cin2,
TCollection cout)
Appends the values of the first and second collection to the output collection |
|
static
|
append(java.util.Iterator<? extends T> iter1,
java.util.Iterator<? extends T> iter2)
Returns an Iterator that will return elements from the first input iterator followed by elements from the second input iterator. |
|
static
|
append(T[] t0,
T[] t1)
Returns all elements of each array |
|
static
|
merge(java.lang.Iterable<? extends T> input0,
java.lang.Iterable<? extends T> input1)
Returns an Iterable implementation that 'contains' all elements of both iterables, always choosing the lesser of the two current elements. |
|
static
|
merge(java.lang.Iterable<? extends T> i1,
java.lang.Iterable<? extends T> i2,
BinaryFunctor<T,T,java.lang.Boolean> pred)
Returns all elements of both iterables, always choosing the lesser of the two current elements by using the given predicate. |
|
static
|
merge(java.lang.Iterable<? extends T> cin1,
java.lang.Iterable<? extends T> cin2,
BinaryFunctor<T,T,java.lang.Boolean> pred,
TCollection cout)
Merges two collections using the given comparator, appending values to the output collection. |
|
static
|
merge(java.lang.Iterable<? extends T> i1,
java.lang.Iterable<? extends T> i2,
java.util.Comparator<T> comp)
Returns all elements of both iterables, always choosing the lesser of the two current elements. |
|
static
|
merge(java.lang.Iterable<? extends T> cin1,
java.lang.Iterable<? extends T> cin2,
java.util.Comparator<T> comp,
TCollection cout)
Merges two collections using the given comparator, appending values to the output collection. |
|
static
|
merge(java.lang.Iterable<? extends T> cin1,
java.lang.Iterable<? extends T> cin2,
TCollection cout)
Merges two collections, appending values to the output collection. |
|
static
|
merge(java.util.Iterator<? extends T> iter1,
java.util.Iterator<? extends T> iter2)
Returns an Iterator that will return elements from both input iterators, choosing the lesser of the two current values. |
|
static
|
merge(java.util.Iterator<? extends T> iter1,
java.util.Iterator<? extends T> iter2,
BinaryFunctor<T,T,java.lang.Boolean> pred)
Returns an Iterator that will return elements from both input iterators, choosing the lesser of the two current values by using the given predicate. |
|
static
|
merge(java.util.Iterator<? extends T> iter1,
java.util.Iterator<? extends T> iter2,
java.util.Comparator<T> comp)
Returns an Iterator that will return elements from both input iterators, choosing the lesser of the two current values using the given comparator. |
|
static
|
merge(T[] t0,
T[] t1)
Returns all elements of each array, always choosing the least of the current elements. |
|
static
|
merge(T[] ts1,
T[] ts2,
BinaryFunctor<T,T,java.lang.Boolean> pred)
Returns all elements of both arrays, always choosing the lesser of the two current elements by using the given predicate. |
|
static
|
merge(T[] ts1,
T[] ts2,
java.util.Comparator<T> comp)
Returns all elements of both arrays, always choosing the lesser of the two current elements using the given comparator. |
|
static
|
mergeAppend(TCollection cout,
BinaryFunctor<T,T,java.lang.Boolean> pred,
java.lang.Iterable<? extends T> cin0,
java.lang.Iterable<? extends T> cin1)
Merges two collections using the given comparator, appending values to the output collection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Merge()
Method Detail |
---|
public static <T> java.lang.Iterable<T> append(T[] t0, T[] t1)
public static <T extends java.lang.Comparable<? super T>> java.lang.Iterable<T> merge(T[] t0, T[] t1)
public static <T> java.lang.Iterable<T> merge(T[] ts1, T[] ts2, java.util.Comparator<T> comp)
public static <T> java.lang.Iterable<T> merge(T[] ts1, T[] ts2, BinaryFunctor<T,T,java.lang.Boolean> pred)
public static <T> java.lang.Iterable<? extends T> append(java.lang.Iterable<? extends T> input0, java.lang.Iterable<? extends T> input1)
public static <T extends java.lang.Comparable<? super T>> java.lang.Iterable<? extends T> merge(java.lang.Iterable<? extends T> input0, java.lang.Iterable<? extends T> input1)
public static <T> java.lang.Iterable<T> merge(java.lang.Iterable<? extends T> i1, java.lang.Iterable<? extends T> i2, java.util.Comparator<T> comp)
public static <T> java.lang.Iterable<T> merge(java.lang.Iterable<? extends T> i1, java.lang.Iterable<? extends T> i2, BinaryFunctor<T,T,java.lang.Boolean> pred)
public static <T> java.util.Iterator<? extends T> append(java.util.Iterator<? extends T> iter1, java.util.Iterator<? extends T> iter2)
public static <T extends java.lang.Comparable<? super T>> java.util.Iterator<T> merge(java.util.Iterator<? extends T> iter1, java.util.Iterator<? extends T> iter2)
public static <T> java.util.Iterator<T> merge(java.util.Iterator<? extends T> iter1, java.util.Iterator<? extends T> iter2, java.util.Comparator<T> comp)
public static <T> java.util.Iterator<T> merge(java.util.Iterator<? extends T> iter1, java.util.Iterator<? extends T> iter2, BinaryFunctor<T,T,java.lang.Boolean> pred)
public static <T,TCollection extends java.util.Collection<? super T>> TCollection append(java.lang.Iterable<? extends T> cin1, java.lang.Iterable<? extends T> cin2, TCollection cout)
public static <T extends java.lang.Comparable<? super T>,TCollection extends java.util.Collection<? super T>> TCollection merge(java.lang.Iterable<? extends T> cin1, java.lang.Iterable<? extends T> cin2, TCollection cout)
public static <T,TCollection extends java.util.Collection<? super T>> TCollection merge(java.lang.Iterable<? extends T> cin1, java.lang.Iterable<? extends T> cin2, java.util.Comparator<T> comp, TCollection cout)
public static <T,TCollection extends java.util.Collection<? super T>> TCollection merge(java.lang.Iterable<? extends T> cin1, java.lang.Iterable<? extends T> cin2, BinaryFunctor<T,T,java.lang.Boolean> pred, TCollection cout)
public static <T,TCollection extends java.util.Collection<? super T>> TCollection mergeAppend(TCollection cout, BinaryFunctor<T,T,java.lang.Boolean> pred, java.lang.Iterable<? extends T> cin0, java.lang.Iterable<? extends T> cin1)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |