FileDocCategorySizeDatePackage
OrOperator.javaAPI DocGlassfish v2 API4041Sat May 05 19:17:28 BST 2007org.apache.taglibs.standard.lang.jstl

OrOperator

public class OrOperator extends BinaryOperator

The implementation of the or operator

author
Nathan Abramson - Art Technology Group
version
$Change: 181177 $$DateTime: 2001/06/26 08:45:09 $$Author: tcfujii $

Fields Summary
public static final OrOperator
SINGLETON
Constructors Summary
public OrOperator()
Constructor


  //-------------------------------------
      
    
  
  
Methods Summary
public java.lang.Objectapply(java.lang.Object pLeft, java.lang.Object pRight, java.lang.Object pContext, Logger pLogger)
Applies the operator to the given value

    // Coerce the values to booleans
    boolean left = 
      Coercions.coerceToBoolean (pLeft, pLogger).booleanValue ();
    boolean right = 
      Coercions.coerceToBoolean (pRight, pLogger).booleanValue ();

    return PrimitiveObjects.getBoolean (left || right);
  
public java.lang.StringgetOperatorSymbol()
Returns the symbol representing the operator

    return "or";
  
public booleanshouldCoerceToBoolean()
Returns true if the operator expects its arguments to be coerced to Booleans. The And/Or operators set this to true.

    return true;
  
public booleanshouldEvaluate(java.lang.Object pLeft)
Returns true if evaluation is necessary given the specified Left value. The And/OrOperators make use of this

    return
      (pLeft instanceof Boolean) &&
      ((Boolean) pLeft).booleanValue () == false;