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