All Packages Class Hierarchy This Package Previous Next Index
Class COM.objectspace.jgl.predicates.BinaryTern
java.lang.Object
|
+----COM.objectspace.jgl.predicates.BinaryTern
- public final class BinaryTern
- extends Object
- implements BinaryPredicate
BinaryTern is a unary predicate that represents the ternary operator (?:)
in JGL.
- See Also:
- UnaryTern
-
BinaryTern(BinaryPredicate, BinaryPredicate, BinaryPredicate)
- Construct myself to emulate the ternary operator.
-
execute(Object, Object)
- Perform my conditional predicate on the operand, and use the return
value of that to determine which predicate to evaluate.
BinaryTern
public BinaryTern(BinaryPredicate ifPred,
BinaryPredicate thenPred,
BinaryPredicate elsePred)
- Construct myself to emulate the ternary operator. All parameters should
be BinaryPredicates.
- Parameters:
- ifPred - The condition.
- thenPred - Evaluated if
ifPred
returns true.
- elsePred - Evaluated if
ifPred
returns false.
execute
public boolean execute(Object first,
Object second)
- Perform my conditional predicate on the operand, and use the return
value of that to determine which predicate to evaluate.
- Parameters:
- first - The operand.
- second - The operand.
- Returns:
- ifPred( object ) ? thenPred( object ) : elsePred( object )
All Packages Class Hierarchy This Package Previous Next Index