|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.molae.pipe.binop.AbstractBinaryFunction<S,S,T>
net.sf.molae.pipe.binop.SymmetricBinaryFunction<T,T>
net.sf.molae.pipe.sorted.Min<T>
public final class Min<T>
The binary function returning the minimum of two objects.
Max| Constructor Summary | |
|---|---|
Min(Comparator<? super T> comparator)
Creates a new minimum function based on the specified comparator. |
|
Min(Comparator<? super T> comparator,
T negativeInfinity,
T positiveInfinity)
Creates a new minimum function with the specified properties. |
|
| Method Summary | ||
|---|---|---|
T |
compute(T arg1,
T arg2)
Compares the two specified objects and returns the smaller one. |
|
static
|
getInstance()
Returns the default instance of this class. |
|
static
|
min(Collection<T> c)
Returns the smallest element from the specified collection. |
|
static
|
min(Collection<T> c,
Comparator<? super T> comparator)
Returns the smallest element from the specified collection using the specified comparator. |
|
| Methods inherited from class net.sf.molae.pipe.binop.SymmetricBinaryFunction |
|---|
getIdentityElement, getSink, isAnIdentityElement, isASink |
| Methods inherited from class net.sf.molae.pipe.binop.AbstractBinaryFunction |
|---|
getFirstInverse, getPermuted, isAssociative, isLeftSink, isRightIdentityElement, setFirstInverse, setPermuted, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Min(Comparator<? super T> comparator,
T negativeInfinity,
T positiveInfinity)
comparator - comparator to use for comparison
or null if natural ordering is usednegativeInfinity - the negative infinity of the comparator
or null if such an element does not exist.positiveInfinity - the positive infinity of the comparator
or null if such an element does not exist.public Min(Comparator<? super T> comparator)
comparator - comparator to use for comparison
or null if natural ordering is used| Method Detail |
|---|
public static <T extends Comparable<T>> Min<T> getInstance()
public T compute(T arg1,
T arg2)
compute in interface BinaryFunction<T,T,T>compute in class AbstractBinaryFunction<T,T,T>arg1 - first object to comparearg2 - second object to compare
arg1 and arg2.
If both are equal, arg1 is returned.
ClassCastException - if arg1 and arg2
cannot be compared to one another using
the underlying comparator (or, if it is null,
using natural ordering).
NullPointerException - if o1 or o2
is null and natural order is used,
or if the comparator does not tolerate null elements.
public static <T> T min(Collection<T> c,
Comparator<? super T> comparator)
null is returned.
c - collection to searchcomparator - comparator to use for comparison
or null if natural ordering is used
public static <T extends Comparable<T>> T min(Collection<T> c)
null is returned.
c - collection to search
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||