| net.sf.jga.fn.property.CompareProperty
CompareProperty | public class CompareProperty extends UnaryPredicate (Code) | | Unary Predicate that compares the value of the named property to the
given value. The type of comparison is a binary predicate: the two
arguments passed to the predicate are the value of the argument's property
in the first position and the constant value passed at construction in the
second position.
The test returns
bp(getProperty(name).fn(arg), value) . This is also
equivalent to the following:
UnaryPredicate CompareProperty =
new UnaryCompose(new Binder2nd(bp, value),
new GetProperty(propName))
with one less call to fn at evaluation and somewhat clearer
construction syntax.
To Serialize a CompareProperty, the generic parameter V must be serializable.
Copyright © 2003-2005 David A. Hall
author: David A. Hall |
Constructor Summary | |
public | CompareProperty(Class<T> argType, String propName, V val) Builds the CompareProperty predicate that will compare the named
property of an instance of type argType to the given value using
an EqualTo predicate. | public | CompareProperty(Class<T> argType, String propName, BinaryFunctor<V, V, Boolean> pred, V val) Builds the CompareProperty predicate that will compare the named
property of an instance of type argType to the given value. |
serialVersionUID | final static long serialVersionUID(Code) | | |
CompareProperty | public CompareProperty(Class<T> argType, String propName, V val)(Code) | | Builds the CompareProperty predicate that will compare the named
property of an instance of type argType to the given value using
an EqualTo predicate.
|
CompareProperty | public CompareProperty(Class<T> argType, String propName, BinaryFunctor<V, V, Boolean> pred, V val)(Code) | | Builds the CompareProperty predicate that will compare the named
property of an instance of type argType to the given value. The
comparison can be any type of BinaryFunctor where both arguments
are of the same type.
|
accept | public void accept(net.sf.jga.fn.Visitor v)(Code) | | Calls the Visitor's visit(CompareProperty) method, if it
implements the nested Visitor interface.
|
fn | public Boolean fn(T arg)(Code) | | Tests the designated property of the argument against the value given at
construction.
the boolean value of the comparison |
getPredicate | public BinaryFunctor<V, V, Boolean> getPredicate()(Code) | | Returns the predicate used to compare property values
the predicate used to compare property values. |
getPropName | public String getPropName()(Code) | | Returns the name of the property to be compared
the name of the property to be compared |
getValue | public V getValue()(Code) | | Returns the constant value to which properties are compared
the constant value to which properties are compared |
|
|