|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jga.algorithms.Compare
public class Compare
Algorithms and utilities that compare two sets of input. The inputs may be arrays, collections, or iterations (although, in the case of iterations, the comparison also consumes elements from the iteration).
Copyright © 2007 David Hall
Nested Class Summary | |
---|---|
static class |
Compare.IteratorComparator<T>
|
Constructor Summary | |
---|---|
Compare()
|
Method Summary | ||
---|---|---|
static
|
compare(java.lang.Iterable<? extends T> c1,
java.lang.Iterable<? extends T> c2)
Compares the contents of the two iterable resources using a default comparator. |
|
static
|
compare(java.lang.Iterable<? extends T> c1,
java.lang.Iterable<? extends T> c2,
BinaryFunctor<T,T,java.lang.Boolean> bf)
Compares the contents of the two iterable resources using a binary predicate that returns TRUE when its first argument is less than its second. |
|
static
|
compare(java.lang.Iterable<? extends T> c1,
java.lang.Iterable<? extends T> c2,
java.util.Comparator<? super T> comp)
Compares the contents of the two iterable resources. |
|
static
|
compare(java.util.Iterator<? extends T> i1,
java.util.Iterator<? extends T> i2)
Compares the contents of the two iterations using a default comparator. |
|
static
|
compare(java.util.Iterator<? extends T> i1,
java.util.Iterator<? extends T> i2,
BinaryFunctor<T,T,java.lang.Boolean> bf)
Compares the contents of the two iterations using a predicate that returns TRUE if its first argument is less than its second. |
|
static
|
compare(java.util.Iterator<? extends T> i1,
java.util.Iterator<? extends T> i2,
java.util.Comparator<? super T> comp)
Compares the contents of the two iterations using the given comparator. |
|
static
|
compare(T[] a1,
T[] a2)
Compares the contents of the two arrays using a default comparator. |
|
static
|
compare(T[] a1,
T[] a2,
BinaryFunctor<T,T,java.lang.Boolean> bf)
Compares the contents of the two arrays using a binary predicate that returns TRUE when its first argument is less than its second. |
|
static
|
compare(T[] a1,
T[] a2,
java.util.Comparator<T> comp)
Compares the contents of the two arrays using the given comparator. |
|
static
|
equal(java.lang.Iterable<? extends T> c1,
java.lang.Iterable<? extends T> c2)
Returns true if the two resources are equal, using the equals() method to compare the elements of each resource |
|
static
|
equal(java.lang.Iterable<? extends T> c1,
java.lang.Iterable<? extends T> c2,
BinaryFunctor<T,T,java.lang.Boolean> eq)
Returns true if the two resources are equal, using the given functor to compare the elements in each resources. |
|
static
|
equal(java.lang.Iterable<? extends T> c1,
java.lang.Iterable<? extends T> c2,
java.util.Comparator<T> comp)
Returns true if the two resources are equal, using the given comparator to compare the elements in each resource |
|
static
|
equal(java.util.Iterator<? extends T> i1,
java.util.Iterator<? extends T> i2)
Returns true if the two iterations are equal, using the Comparable interface to compare elements in the iterations. |
|
static
|
equal(java.util.Iterator<? extends T> i1,
java.util.Iterator<? extends T> i2,
BinaryFunctor<T,T,java.lang.Boolean> eq)
Returns true if the two iterations are equal, using the given BinaryFunctor to compare elements in the iterations. |
|
static
|
equal(java.util.Iterator<? extends T> i1,
java.util.Iterator<? extends T> i2,
java.util.Comparator<T> comp)
Returns true if the two iterations are equal, using the given Comparator to compare elements in the iterations. |
|
static
|
equal(T[] a1,
T[] a2)
Returns true if the two arrays are equal, using the equals() method to compare the elements of each array |
|
static
|
equal(T[] a1,
T[] a2,
BinaryFunctor<T,T,java.lang.Boolean> eq)
Returns true if the two arrays are equal, using the given functor to compare the elements in each arrays. |
|
static
|
equal(T[] a1,
T[] a2,
java.util.Comparator<T> comp)
Returns true if the two arrays are equal, using the given comparator to compare the elements in each array |
|
static
|
lessThan(java.lang.Iterable<? extends T> c1,
java.lang.Iterable<? extends T> c2)
Returns true if the first resource is lexically less than the second, using the default comparison operation to compare the elements in each resource. |
|
static
|
lessThan(java.lang.Iterable<? extends T> c1,
java.lang.Iterable<? extends T> c2,
BinaryFunctor<T,T,java.lang.Boolean> lt)
Returns true if the first resource is lexically less than the second, using the given operator to compare the elements in each collection. |
|
static
|
lessThan(java.lang.Iterable<? extends T> c1,
java.lang.Iterable<? extends T> c2,
java.util.Comparator<T> comp)
Returns true if the first resource is lexically less than the second, using the given comparator to compare the elements in each resource. |
|
static
|
lessThan(java.util.Iterator<? extends T> i1,
java.util.Iterator<? extends T> i2)
Returns true if the first iterator is lexically less than the second, using the default comparison operation to compare the elements in each iterator. |
|
static
|
lessThan(java.util.Iterator<? extends T> i1,
java.util.Iterator<? extends T> i2,
BinaryFunctor<T,T,java.lang.Boolean> lt)
Returns true if the first iterator is lexically less than the second, using the given operator to compare the elements in each iterator. |
|
static
|
lessThan(java.util.Iterator<? extends T> i1,
java.util.Iterator<? extends T> i2,
java.util.Comparator<T> comp)
Returns true if the first iterator is lexically less than the second, using the given comparator to compare the elements in each iterator. |
|
static
|
lessThan(T[] a1,
T[] a2)
Returns true if the first array is lexically less than the second, using the default comparison operation to compare the elements in each array. |
|
static
|
lessThan(T[] a1,
T[] a2,
BinaryFunctor<T,T,java.lang.Boolean> lt)
Returns true if the first array is lexically less than the second, using the given operator to compare the elements in each collection. |
|
static
|
lessThan(T[] a1,
T[] a2,
java.util.Comparator<T> comp)
Returns true if the first array is lexically less than the second, using the given comparator to compare the elements in each array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Compare()
Method Detail |
---|
public static <T> boolean equal(T[] a1, T[] a2)
public static <T> boolean equal(T[] a1, T[] a2, java.util.Comparator<T> comp)
public static <T> boolean equal(T[] a1, T[] a2, BinaryFunctor<T,T,java.lang.Boolean> eq)
public static <T extends java.lang.Comparable<? super T>> boolean lessThan(T[] a1, T[] a2)
public static <T> boolean lessThan(T[] a1, T[] a2, java.util.Comparator<T> comp)
public static <T> boolean lessThan(T[] a1, T[] a2, BinaryFunctor<T,T,java.lang.Boolean> lt)
public static <T extends java.lang.Comparable<? super T>> int compare(T[] a1, T[] a2)
public static <T> int compare(T[] a1, T[] a2, BinaryFunctor<T,T,java.lang.Boolean> bf)
public static <T> int compare(T[] a1, T[] a2, java.util.Comparator<T> comp)
public static <T> boolean equal(java.lang.Iterable<? extends T> c1, java.lang.Iterable<? extends T> c2)
public static <T> boolean equal(java.lang.Iterable<? extends T> c1, java.lang.Iterable<? extends T> c2, java.util.Comparator<T> comp)
public static <T> boolean equal(java.lang.Iterable<? extends T> c1, java.lang.Iterable<? extends T> c2, BinaryFunctor<T,T,java.lang.Boolean> eq)
public static <T extends java.lang.Comparable<? super T>> boolean lessThan(java.lang.Iterable<? extends T> c1, java.lang.Iterable<? extends T> c2)
public static <T> boolean lessThan(java.lang.Iterable<? extends T> c1, java.lang.Iterable<? extends T> c2, java.util.Comparator<T> comp)
public static <T> boolean lessThan(java.lang.Iterable<? extends T> c1, java.lang.Iterable<? extends T> c2, BinaryFunctor<T,T,java.lang.Boolean> lt)
public static <T extends java.lang.Comparable<? super T>> int compare(java.lang.Iterable<? extends T> c1, java.lang.Iterable<? extends T> c2)
public static <T> int compare(java.lang.Iterable<? extends T> c1, java.lang.Iterable<? extends T> c2, BinaryFunctor<T,T,java.lang.Boolean> bf)
public static <T> int compare(java.lang.Iterable<? extends T> c1, java.lang.Iterable<? extends T> c2, java.util.Comparator<? super T> comp)
public static <T extends java.lang.Comparable<? super T>> boolean equal(java.util.Iterator<? extends T> i1, java.util.Iterator<? extends T> i2)
public static <T> boolean equal(java.util.Iterator<? extends T> i1, java.util.Iterator<? extends T> i2, java.util.Comparator<T> comp)
public static <T> boolean equal(java.util.Iterator<? extends T> i1, java.util.Iterator<? extends T> i2, BinaryFunctor<T,T,java.lang.Boolean> eq)
public static <T extends java.lang.Comparable<? super T>> boolean lessThan(java.util.Iterator<? extends T> i1, java.util.Iterator<? extends T> i2)
public static <T> boolean lessThan(java.util.Iterator<? extends T> i1, java.util.Iterator<? extends T> i2, java.util.Comparator<T> comp)
public static <T> boolean lessThan(java.util.Iterator<? extends T> i1, java.util.Iterator<? extends T> i2, BinaryFunctor<T,T,java.lang.Boolean> lt)
public static <T extends java.lang.Comparable<? super T>> int compare(java.util.Iterator<? extends T> i1, java.util.Iterator<? extends T> i2)
Neither iteration will be advanced past the point where an unequal pair is found, but the elements that were unequal will have been consumed.
public static <T> int compare(java.util.Iterator<? extends T> i1, java.util.Iterator<? extends T> i2, BinaryFunctor<T,T,java.lang.Boolean> bf)
Neither iteration will be advanced past the point where an unequal pair is found, but the elements that were unequal will have been consumed.
public static <T> int compare(java.util.Iterator<? extends T> i1, java.util.Iterator<? extends T> i2, java.util.Comparator<? super T> comp)
Neither iteration will be advanced past the point where an unequal pair is found, but the elements that were unequal will have been consumed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |