|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.jga.fn.BinaryFunctor<java.util.Iterator<? extends T>,java.util.Iterator<? extends T>,MergeIterator<T>>
net.sf.jga.fn.algorithm.Merge<T>
public class Merge<T>
Returns an iterator based on the two input iterators that will merge their contents. If the contents of both input iterators are sorted, then the iterator returned will be sorted as well.
To serialize a Merge, the comparator passed at construction must be Serializable.
Copyright © 2003 David A. Hall
| Nested Class Summary | |
|---|---|
static interface |
Merge.Visitor
Interface for classes that may interpret an Merge functor. |
| Constructor Summary | |
|---|---|
Merge(java.util.Comparator<T> comp)
Builds an Merge functor that will use the given comparator to compare corresponding elements of two input iterators.. |
|
| Method Summary | |
|---|---|
void |
accept(Visitor v)
Calls the Visitor's visit(Merge) method, if it
implements the nested Visitor interface. |
MergeIterator<T> |
fn(java.util.Iterator<? extends T> iter1,
java.util.Iterator<? extends T> iter2)
Apply the functor to each element in the iteration and return an iterator over the results |
java.util.Comparator<T> |
getComparator()
Returns the functor used to process elements in an iteration. |
java.lang.String |
toString()
|
| Methods inherited from class net.sf.jga.fn.BinaryFunctor |
|---|
bind, bind1st, bind2nd, compose, compose, distribute, generate, generate1st, generate2nd |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Merge(java.util.Comparator<T> comp)
java.lang.IllegalArgumentException - if the test is null| Method Detail |
|---|
public java.util.Comparator<T> getComparator()
public MergeIterator<T> fn(java.util.Iterator<? extends T> iter1,
java.util.Iterator<? extends T> iter2)
fn in class BinaryFunctor<java.util.Iterator<? extends T>,java.util.Iterator<? extends T>,MergeIterator<T>>public void accept(Visitor v)
visit(Merge) method, if it
implements the nested Visitor interface.
accept in interface Visitableaccept in class BinaryFunctor<java.util.Iterator<? extends T>,java.util.Iterator<? extends T>,MergeIterator<T>>public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||