| net.sf.jga.fn.comparison.EqualTo
EqualTo | public class EqualTo extends Equality (Code) | | Binary Predicate that returns TRUE for object arguments x and
y when x == y using the built-in equals() method or an optional
Comparator given at construction. By default, this functor will not throw
NullPointerException: it will return true if both runtime arguments are null
but false if only one is null. If an optional comparator is used, then its
implementation will determine if a NullPointerException is thrown when passed
a null argument.
To serialize an Equal functor, the comparator passed at construction(if any)
must be Serializable.
Copyright © 2002-2005 David A. Hall
author: David A. Hall |
Constructor Summary | |
public | EqualTo() Builds an EqualTo that uses the built-in equals method. | public | EqualTo(Comparator<? super T> comp) Builds an EqualTo that uses the given comparator. |
serialVersionUID | final static long serialVersionUID(Code) | | |
EqualTo | public EqualTo()(Code) | | Builds an EqualTo that uses the built-in equals method.
|
EqualTo | public EqualTo(Comparator<? super T> comp)(Code) | | Builds an EqualTo that uses the given comparator.
|
accept | public void accept(net.sf.jga.fn.Visitor v)(Code) | | Calls the Visitor's visit(EqualTo) method, if it
implements the nested Visitor interface.
|
fn | public Boolean fn(T x, T y)(Code) | | Given arguments x and y, returns x.equals(y). Will not
throw NullPointerException if either x or y are null: will return true
if both x and y are null and false if either x or y are null.
x.equals(y) |
getComparator | public Comparator<? super T> getComparator()(Code) | | Returns the comparator in use by this functor, if any.
the comparator in use by this functor, if any. |
|
|