FileDocCategorySizeDatePackage
AndOperator.javaAPI DocGlassfish v2 API4046Sat May 05 19:17:26 BST 2007org.apache.taglibs.standard.lang.jstl

AndOperator

public class AndOperator extends BinaryOperator

The implementation of the and operator

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

Fields Summary
public static final AndOperator
SINGLETON
Constructors Summary
public AndOperator()
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 "and";
  
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 () == true;