net.christopherschultz.evaluator.function
Class NonShortCircuitAnd

java.lang.Object
  extended by net.christopherschultz.evaluator.function.NonShortCircuitAnd
All Implemented Interfaces:
Function

public class NonShortCircuitAnd
extends Object
implements Function

Implements a non-short-circuit boolean AND operation for an arbitrary number of arguments.

In a short-circuit boolean operation, arguments are evaluated in a left-to-right fashion, stopping at the fist argument that fails to meet the criteria. For example, an AND operation would immediately return FALSE at the first FALSE argument that was encountered. Likewise, an OR operation would immediately return TRUE at the first TRUE argument that was encountered.

This function will return null if any null argument is present, regardless of the others. That means that this function will only return a definite value (true or false) if all arguments have values.

Version:
$Revision: 1.2 $ $Date: 2008-06-20 22:58:48 $
Author:
Chris Schultz

Constructor Summary
NonShortCircuitAnd()
          Creates a new NonShortCircuitAnd object.
 
Method Summary
 Object call(EvaluationContext ec, String functionName, List argumentExpressions)
          Invokes the function with the specified argument expressions in the specified evaluation context.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NonShortCircuitAnd

public NonShortCircuitAnd()
Creates a new NonShortCircuitAnd object.

Method Detail

call

public Object call(EvaluationContext ec,
                   String functionName,
                   List argumentExpressions)
            throws EvaluationException
Description copied from interface: Function
Invokes the function with the specified argument expressions in the specified evaluation context.

Specified by:
call in interface Function
Parameters:
ec - The EvaluationContext in which this function is being called.
functionName - The name of the function being called.
argumentExpressions - The expressions which, when evaluated, result in the arguments to the function.
Returns:
The result of the function.
Throws:
EvaluationException - If there is a problem evaluating any of the arguments' expressions, or if there is an error during function execution.

toString

public String toString()
Overrides:
toString in class Object