| java.lang.Object net.sf.jga.algorithms.Merge
All known Subclasses: net.sf.jga.util.MergeIterable, net.sf.jga.util.MergeIterator,
Merge | public class Merge (Code) | | Algorithms that combine the contents of two inputs. The inputs may arrays, collections, or
iterations.
Copyright © 2006 David A. Hall
|
Inner Class :public static class MergeIterable implements Iterable<T> | |
Inner Class :public static class MergeIterator implements Iterator<T> | |
Method Summary | |
public static Iterable<T> | append(T[] ts1, T[] ts2) | public static Iterable<T> | append(Iterable<? extends T> i1, Iterable<? extends T> i2) | public static Iterator<T> | append(Iterator<? extends T> iter1, Iterator<? extends T> iter2) Returns an Iterator that will return elements from the first input iterator followed by
elements from the second input iterator. | public static TCollection | append(Iterable<? extends T> cin1, Iterable<? extends T> cin2, TCollection cout) | public static Iterable<T> | merge(T[] ts1, T[] ts2) Returns all elements of both arrays, always choosing the lesser of the two current elements. | public static Iterable<T> | merge(T[] ts1, T[] ts2, Comparator<T> comp) Returns all elements of both arrays, always choosing the lesser of the two current elements
using the given comparator. | public static Iterable<T> | merge(T[] ts1, T[] ts2, BinaryFunctor<T, T, Boolean> pred) Returns all elements of both arrays, always choosing the lesser of the two current elements
by using the given predicate. | public static Iterable<T> | merge(Iterable<? extends T> i1, Iterable<? extends T> i2) Returns an Iterable implementation that 'contains' all elements of both iterables, always
choosing the lesser of the two current elements. | public static Iterable<T> | merge(Iterable<? extends T> i1, Iterable<? extends T> i2, Comparator<T> comp) Returns all elements of both iterables, always choosing the lesser of the two current
elements. | public static Iterable<T> | merge(Iterable<? extends T> i1, Iterable<? extends T> i2, BinaryFunctor<T, T, Boolean> pred) Returns all elements of both iterables, always choosing the lesser of the two current
elements by using the given predicate. | public static Iterator<T> | merge(Iterator<? extends T> iter1, Iterator<? extends T> iter2) Returns an Iterator that will return elements from both input iterators, choosing the
lesser of the two current values. | public static Iterator<T> | merge(Iterator<? extends T> iter1, Iterator<? extends T> iter2, 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. | public static Iterator<T> | merge(Iterator<? extends T> iter1, Iterator<? extends T> iter2, BinaryFunctor<T, T, 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. | public static TCollection | merge(Iterable<? extends T> cin1, Iterable<? extends T> cin2, TCollection cout) Merges two collections, appending values to the output collection. | public static TCollection | merge(Iterable<? extends T> cin1, Iterable<? extends T> cin2, Comparator<T> comp, TCollection cout) Merges two collections using the given comparator, appending values to the output collection. | public static TCollection | merge(Iterable<? extends T> cin1, Iterable<? extends T> cin2, BinaryFunctor<T, T, Boolean> pred, TCollection cout) Merges two collections using the given comparator, appending values to the output collection. |
append | public static Iterable<T> append(T[] ts1, T[] ts2)(Code) | | Returns all elements of the first array followed by all the elements of the second array
|
append | public static Iterable<T> append(Iterable<? extends T> i1, Iterable<? extends T> i2)(Code) | | Returns an Iterable implementation that 'contains' all elements of first iterable followed by
all elements of the second iterable
|
append | public static Iterator<T> append(Iterator<? extends T> iter1, Iterator<? extends T> iter2)(Code) | | Returns an Iterator that will return elements from the first input iterator followed by
elements from the second input iterator.
|
append | public static TCollection append(Iterable<? extends T> cin1, Iterable<? extends T> cin2, TCollection cout)(Code) | | Appends the values of the first and second collection to the output collection
the output collection |
merge | public static Iterable<T> merge(T[] ts1, T[] ts2)(Code) | | Returns all elements of both arrays, always choosing the lesser of the two current elements.
|
merge | public static Iterable<T> merge(T[] ts1, T[] ts2, Comparator<T> comp)(Code) | | Returns all elements of both arrays, always choosing the lesser of the two current elements
using the given comparator.
|
merge | public static Iterable<T> merge(T[] ts1, T[] ts2, BinaryFunctor<T, T, Boolean> pred)(Code) | | Returns all elements of both arrays, always choosing the lesser of the two current elements
by using the given predicate. When the predicate returns TRUE, an element is taken from the
first array: when FALSE, an element is taken from the second array.
|
merge | public static Iterable<T> merge(Iterable<? extends T> i1, Iterable<? extends T> i2)(Code) | | Returns an Iterable implementation that 'contains' all elements of both iterables, always
choosing the lesser of the two current elements.
|
merge | public static Iterable<T> merge(Iterable<? extends T> i1, Iterable<? extends T> i2, Comparator<T> comp)(Code) | | Returns all elements of both iterables, always choosing the lesser of the two current
elements.
|
merge | public static Iterable<T> merge(Iterable<? extends T> i1, Iterable<? extends T> i2, BinaryFunctor<T, T, Boolean> pred)(Code) | | Returns all elements of both iterables, always choosing the lesser of the two current
elements by using the given predicate. When the predicate returns TRUE, an element is
taken from the first array: when FALSE, an element is taken from the second array.
|
merge | public static Iterator<T> merge(Iterator<? extends T> iter1, Iterator<? extends T> iter2)(Code) | | Returns an Iterator that will return elements from both input iterators, choosing the
lesser of the two current values. Neither input iterator is advanced in this method.
|
merge | public static Iterator<T> merge(Iterator<? extends T> iter1, Iterator<? extends T> iter2, Comparator<T> comp)(Code) | | Returns an Iterator that will return elements from both input iterators, choosing the
lesser of the two current values using the given comparator. Neither input iterator
is advanced in this method.
|
merge | public static Iterator<T> merge(Iterator<? extends T> iter1, Iterator<? extends T> iter2, BinaryFunctor<T, T, Boolean> pred)(Code) | | Returns an Iterator that will return elements from both input iterators, choosing the
lesser of the two current values by using the given predicate. When the predicate
returns TRUE, an element is taken from the first array: when FALSE, an element is taken
from the second iterator. Neither input iterator is advanced in this method.
|
merge | public static TCollection merge(Iterable<? extends T> cin1, Iterable<? extends T> cin2, TCollection cout)(Code) | | Merges two collections, appending values to the output collection.
the output collection |
merge | public static TCollection merge(Iterable<? extends T> cin1, Iterable<? extends T> cin2, Comparator<T> comp, TCollection cout)(Code) | | Merges two collections using the given comparator, appending values to the output collection.
the output collection |
merge | public static TCollection merge(Iterable<? extends T> cin1, Iterable<? extends T> cin2, BinaryFunctor<T, T, Boolean> pred, TCollection cout)(Code) | | Merges two collections using the given comparator, appending values to the output collection.
the output collection |
|
|