wyvern.lib.predicates
Class LessThanPredicate

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

public class LessThanPredicate
extends ComparisonPredicate

Returns true if quantity A is less than quantity B. You can compare int properties of a GameObject with this kind of predicate.

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

Field Summary
 
Fields inherited from class wyvern.lib.predicates.ComparisonPredicate
name_, value_
 
Constructor Summary
LessThanPredicate(java.lang.String prop, int value)
          Constructs a new LessThanPredicate
 
Method Summary
 boolean predicate(GameObject obj)
          Returns true if the object's int property specified in the constructor of this Predicate is less than the int value passed to the constructor.
 java.lang.String print()
          Prints an English-like description of the predicate, e.g.
 java.lang.String toString()
           
 
Methods inherited from class wyvern.lib.predicates.ComparisonPredicate
getProp, getValue, make
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LessThanPredicate

public LessThanPredicate(java.lang.String prop,
                         int value)
Constructs a new LessThanPredicate

Parameters:
prop - the int property to check
value - the value to compare the property against.
Method Detail

predicate

public boolean predicate(GameObject obj)
Returns true if the object's int property specified in the constructor of this Predicate is less than the int value passed to the constructor.

Parameters:
obj -
Returns:
true if the object's int PROP property is less than VALUE

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"