net.sf.jga.fn.comparison

Class EqualTo<T>

public class EqualTo<T> extends AbstractBinaryPredicate<T,T> implements Equality<T>, Serializable

Binary Predicate that returns TRUE for object arguments x and y when x == y using the built-in equals() method. This object will not throw NullPointerException: it will return true if both runtime arguments are null but false if only one is null.

Copyright © 2002 David A. Hall

Author: David A. Hall

Nested Class Summary
interfaceEqualTo.Visitor
Interface for classes that may interpret an EqualTo predicate.
Method Summary
voidaccept(Visitor v)
Calls the Visitor's visit(EqualTo) method, if it implements the nested Visitor interface.
booleanp(T x, T y)
Given arguments x and y, returns x.equals(y).
StringtoString()

Method Detail

accept

public void accept(Visitor v)
Calls the Visitor's visit(EqualTo) method, if it implements the nested Visitor interface.

p

public boolean p(T x, T y)
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.

Returns: x.equals(y)

toString

public String toString()