wyvern.lib.predicates
Class ComparisonPredicate
java.lang.Object
wyvern.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 |
name_
protected java.lang.String name_
value_
protected int value_
ComparisonPredicate
public ComparisonPredicate(java.lang.String prop,
int value)
- Constructs a new ComparisonPredicate for the specified
property and value.
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 operatorprop
- the name of the int propertyvalue
- the value to compare the property to