wyvern.lib.predicates
Class NotPredicate

java.lang.Object
  extended bywyvern.lib.predicates.NotPredicate
All Implemented Interfaces:
Predicate, PrintablePredicate

public class NotPredicate
extends java.lang.Object
implements Predicate, PrintablePredicate

This predicate returns the opposite of the passed predicate.

Version:
1.0, Jun 06, 1998
Author:
Steve Yegge

Constructor Summary
NotPredicate(Predicate p)
          Constructs a new NotPredicate
 
Method Summary
 Predicate getPredicate()
          Returns the predicate being negated.
 boolean predicate(GameObject obj)
          Returns the opposite of our stored predicate.
 java.lang.String print()
          Prints an English-like description of the predicate, e.g.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NotPredicate

public NotPredicate(Predicate p)
Constructs a new NotPredicate

Method Detail

getPredicate

public Predicate getPredicate()
Returns the predicate being negated.


predicate

public boolean predicate(GameObject obj)
Returns the opposite of our stored predicate.

Specified by:
predicate in interface Predicate
Parameters:
obj - any GameObject
Returns:
true if the object passes, else false

toString

public java.lang.String toString()

print

public java.lang.String print()
Description copied from interface: PrintablePredicate
Prints an English-like description of the predicate, e.g. "NOT name like 'bob'", or "quantity < 100 AND item is cursed"

Specified by:
print in interface PrintablePredicate