jpaul.Misc
Class EqualityPredicate<T>

java.lang.Object
  extended by jpaul.Misc.Predicate<T>
      extended by jpaul.Misc.EqualityPredicate<T>

public class EqualityPredicate<T>
extends Predicate<T>

EqualityPredicate is a simple predicate that checks equality with a reference element. Equality is checked by using .equals.

Version:
$Id: EqualityPredicate.java,v 1.4 2006/03/14 02:29:31 salcianu Exp $
Author:
Alexandru Salcianu - salcianu@alum.mit.edu

Constructor Summary
EqualityPredicate(T referenceElem)
          Creates a EqualityPredicate.
 
Method Summary
 boolean check(T elem)
          The boolean predicate.
 
Methods inherited from class jpaul.Misc.Predicate
AND, FALSE, FULL_AND, FULL_OR, NOT, OR, TRUE
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EqualityPredicate

public EqualityPredicate(T referenceElem)
Creates a EqualityPredicate.

Parameters:
referenceElem - The element we check for equality against. The newly created predicate will be true only for the elements that are equal with referenceElem. We assume that only null is equal to null.
Method Detail

check

public boolean check(T elem)
Description copied from class: Predicate
The boolean predicate.

Specified by:
check in class Predicate<T>


Copyright 2005 Alexandru Salcianu - salcianu@alum.mit.edu