gate.jape.constraint
Class ComparablePredicate
java.lang.Object
gate.jape.constraint.AbstractConstraintPredicate
gate.jape.constraint.ComparablePredicate
- All Implemented Interfaces:
- ConstraintPredicate, Serializable
- Direct Known Subclasses:
- ComparablePredicateTest.ComparablePredicateImpl, GreaterEqualPredicate, GreaterPredicate, LesserEqualPredicate, LesserPredicate
public abstract class ComparablePredicate
- extends AbstractConstraintPredicate
Base class for those predicates which use compareTo
to
compare values.
- Version:
- $Revision$
- Author:
- esword
- See Also:
- Serialized Form
comparableValue
protected Comparable comparableValue
ComparablePredicate
public ComparablePredicate()
setValue
public void setValue(Object value)
- Value must be a Comparable
- Specified by:
setValue
in interface ConstraintPredicate
- Overrides:
setValue
in class AbstractConstraintPredicate
doMatch
public boolean doMatch(Object value,
AnnotationSet context)
throws JapeException
- Specified by:
doMatch
in class AbstractConstraintPredicate
- Throws:
JapeException
doMatch
protected abstract boolean doMatch(Object featureValue)
throws JapeException
- Throws:
JapeException
compareValue
protected int compareValue(Object obj)
throws JapeException
- Use
compareTo
to compare set value with the given
object, doing basic type conversion to get the two objects to the
same class.
- Throws:
JapeException
- if the provided object is not a Comparable or
the classes cannot be compared.