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

Constructor Index

 o BinaryTern(BinaryPredicate, BinaryPredicate, BinaryPredicate)
Construct myself to emulate the ternary operator.

Method Index

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

Constructors

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

Methods

 o 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