org.apache.commons.el

Class BinaryOperator

Known Direct Subclasses:
AndOperator, ArithmeticOperator, DivideOperator, EqualityOperator, IntegerDivideOperator, ModulusOperator, OrOperator, RelationalOperator

public abstract class BinaryOperator
extends java.lang.Object

This is the superclass for all binary operators

Version:
$Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: luehe $

Author:
Nathan Abramson - Art Technology Group

Constructor Summary

BinaryOperator()
Constructor

Method Summary

Object
apply(Object pLeft, Object pRight, Logger pLogger)
Applies the operator to the given pair of values
String
getOperatorSymbol()
Returns the symbol representing the operator
boolean
shouldCoerceToBoolean()
Returns true if the operator expects its arguments to be coerced to Booleans.
boolean
shouldEvaluate(Object pLeft)
Returns true if evaluation is necessary given the specified Left value.

Constructor Details

BinaryOperator

public BinaryOperator()
Constructor

Method Details

apply

public Object apply(Object pLeft,
                    Object pRight,
                    Logger pLogger)
            throws ELException
Applies the operator to the given pair of values


getOperatorSymbol

public String getOperatorSymbol()
Returns the symbol representing the operator


shouldCoerceToBoolean

public boolean shouldCoerceToBoolean()
Returns true if the operator expects its arguments to be coerced to Booleans. The And/Or operators set this to true.


shouldEvaluate

public boolean shouldEvaluate(Object pLeft)
Returns true if evaluation is necessary given the specified Left value. The And/OrOperators make use of this


Copyright (c) 2001-2002 - Apache Software Foundation