wyvern.lib.predicates
Class BooleanPredicate

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

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

Returns true if an object has the specified boolean property.

Version:
1.0, Dec 27, 2003
Author:
Steve Yegge

Constructor Summary
BooleanPredicate(java.lang.String name)
          Constructs a new BooleanPredicate for the specified type.
 
Method Summary
 java.lang.String getProperty()
           
 boolean predicate(GameObject obj)
          Checks an object to see if it passes the 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

BooleanPredicate

public BooleanPredicate(java.lang.String name)
Constructs a new BooleanPredicate for the specified type.

Method Detail

getProperty

public java.lang.String getProperty()

predicate

public boolean predicate(GameObject obj)
Description copied from interface: Predicate
Checks an object to see if it passes the 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