net.sf.jga.algorithms
Class Merge.MergeIterable<T>
java.lang.Object
net.sf.jga.algorithms.Merge.MergeIterable<T>
- All Implemented Interfaces:
- java.lang.Iterable<T>
- Enclosing class:
- Merge
public static class Merge.MergeIterable<T>
- extends java.lang.Object
- implements java.lang.Iterable<T>
Produces iterators that return all of the merged contents of two inputs
Constructor Summary |
Merge.MergeIterable(java.lang.Iterable<? extends T> base1,
java.lang.Iterable<? extends T> base2,
BinaryFunctor<T,T,java.lang.Boolean> pred)
Builds a Merge for the given base iterators that uses the given predicate to compare
corresponding elements. |
Merge.MergeIterable(java.lang.Iterable<? extends T> base1,
java.lang.Iterable<? extends T> base2,
java.util.Comparator<T> comp)
Builds a Merge for the given base iterators that uses the given Comparator to compare
corresponding elements. |
Method Summary |
java.util.Iterator<T> |
iterator()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Merge.MergeIterable
public Merge.MergeIterable(java.lang.Iterable<? extends T> base1,
java.lang.Iterable<? extends T> base2,
java.util.Comparator<T> comp)
- Builds a Merge for the given base iterators that uses the given Comparator to compare
corresponding elements. The Comparator will be used with a LessEqualComp predicate.
- Throws:
java.lang.IllegalArgumentException
- if either argument is null
Merge.MergeIterable
public Merge.MergeIterable(java.lang.Iterable<? extends T> base1,
java.lang.Iterable<? extends T> base2,
BinaryFunctor<T,T,java.lang.Boolean> pred)
- Builds a Merge for the given base iterators that uses the given predicate to compare
corresponding elements. The predicate should return TRUE if its first argument is less
than or equal to the second.
- Throws:
java.lang.IllegalArgumentException
- if either base iterable is null
iterator
public java.util.Iterator<T> iterator()
- Specified by:
iterator
in interface java.lang.Iterable<T>
Copyright © 2002-2006 David A. Hall. All Rights Reserved.