// Copyright(c) 1996,1997 ObjectSpace, Inc.
// Portions Copyright(c) 1995, 1996 Hewlett-Packard Company.

package COM.objectspace.jgl;

/**
 * LogicalAnd is a binary predicate that returns true if both operands are equal to
 * Boolean.TRUE.
 * <p>
 * @see COM.objectspace.jgl.LogicalOr
 * @version 2.0.2
 * @author ObjectSpace, Inc.
 */

public final class LogicalAnd implements BinaryPredicate
  {
  /**
   * Perform a logical AND.
   * @param first The first operand, which must be an instance of Boolean.
   * @param second The second operand, which must be an instance of Boolean.
   * @return true if both operands are equal to Boolean.TRUE.
   */
  public boolean execute( Object first, Object second )
    {
    return ((Boolean) first).booleanValue() && ((Boolean) second).booleanValue();
    }
  }
