wyvern.lib.predicates
Class ComparisonPredicate

java.lang.Object
  extended bywyvern.lib.predicates.ComparisonPredicate
All Implemented Interfaces:
Predicate, PrintablePredicate
Direct Known Subclasses:
EqualPredicate, GreaterOrEqualPredicate, GreaterThanPredicate, LessOrEqualPredicate, LessThanPredicate, NotEqualPredicate

public abstract class ComparisonPredicate
extends java.lang.Object
implements Predicate, PrintablePredicate

Superclass of all the predicates that compare int properties to some int value.

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

Field Summary
protected  java.lang.String name_
           
protected  int value_
           
 
Constructor Summary
ComparisonPredicate(java.lang.String prop, int value)
          Constructs a new ComparisonPredicate for the specified property and value.
 
Method Summary
 java.lang.String getProp()
           
 int getValue()
           
static ComparisonPredicate make(java.lang.String prop, java.lang.String op, int value)
          Factory method that takes an operator, such as "!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface wyvern.lib.Predicate
predicate
 
Methods inherited from interface wyvern.lib.predicates.PrintablePredicate
print
 

Field Detail

name_

protected java.lang.String name_

value_

protected int value_
Constructor Detail

ComparisonPredicate

public ComparisonPredicate(java.lang.String prop,
                           int value)
Constructs a new ComparisonPredicate for the specified property and value.

Method Detail

getProp

public java.lang.String getProp()

getValue

public int getValue()

make

public static ComparisonPredicate make(java.lang.String prop,
                                       java.lang.String op,
                                       int value)
Factory method that takes an operator, such as "!=", a property name, and a value to compare the property to, and returns a suitable ComparisonPredicate.

Parameters:
op - the comparison operator
prop - the name of the int property
value - the value to compare the property to