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

Constructor Index

 o UnaryTern(UnaryPredicate, UnaryPredicate, UnaryPredicate)
Construct myself to emulate the ternary operator.

Method Index

 o execute(Object)
Perform my conditional predicate on the operand, and use the return value of that to determine which predicate to evaluate.

Constructors

 o 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.

Methods

 o 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