Plexus v0.13.1

com.phoenixst.collections
Class EqualPredicate

java.lang.Object
  extended by com.phoenixst.collections.EqualPredicate
All Implemented Interfaces:
Serializable, org.apache.commons.collections.Predicate

public final class EqualPredicate
extends Object
implements org.apache.commons.collections.Predicate, Serializable

A Predicate which simply tests the evaluate( object ) argument for equality with a specified object.

This is mostly equivalent to the class of the same name in Jakarta Commons-Collections 3.0, except that it exposes the test object used in the constructor. No equivalent exists in version 2.1.

Since:
1.0
Version:
$Revision: 1.10 $
Author:
Ray A. Conner
See Also:
Serialized Form

Constructor Summary
EqualPredicate(Object testObject)
          Creates a new EqualPredicate with the specified test object.
 
Method Summary
 boolean equals(Object object)
           
 boolean evaluate(Object object)
          Returns true if the specified object is .equals() to the test object, or if both are null.
 Object getTestObject()
          Returns the test object being used by this EqualPredicate.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EqualPredicate

public EqualPredicate(Object testObject)
Creates a new EqualPredicate with the specified test object.

Method Detail

evaluate

public boolean evaluate(Object object)
Returns true if the specified object is .equals() to the test object, or if both are null.

Specified by:
evaluate in interface org.apache.commons.collections.Predicate

getTestObject

public Object getTestObject()
Returns the test object being used by this EqualPredicate.


equals

public boolean equals(Object object)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

Plexus v0.13.1

See the Plexus project home, hosted by SourceForge.
Copyright ? 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.