wyvern.lib.predicates
Class AndNotPredicate

java.lang.Object
  extended bywyvern.lib.predicates.AndNotPredicate
All Implemented Interfaces:
Predicate

public class AndNotPredicate
extends java.lang.Object
implements Predicate

This predicate combines two other predicates with an AND NOT operation. It returns true only when the first subpredicate is true, and the second one is false.

Version:
1.0, Feb 09, 1998
Author:
Steve Yegge

Constructor Summary
AndNotPredicate(Predicate p1, Predicate p2)
          Constructs a new AndNotPredicate with 2 sub-predicates p1 and p2.
 
Method Summary
 boolean predicate(GameObject obj)
          Returns true if first sub-predicate returns true, and second one returns false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AndNotPredicate

public AndNotPredicate(Predicate p1,
                       Predicate p2)
Constructs a new AndNotPredicate with 2 sub-predicates p1 and p2.

Method Detail

predicate

public boolean predicate(GameObject obj)
Returns true if first sub-predicate returns true, and second one returns false.

Specified by:
predicate in interface Predicate
Parameters:
obj - the object to predicate upon
Returns:
true if it passes the first predicate and not the second