home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / jgl_1_1 / src / logicalor.java < prev    next >
Encoding:
Java Source  |  1996-09-10  |  794 b   |  28 lines

  1. // Copyright(c) 1996 ObjectSpace, Inc.
  2. // Portions Copyright(c) 1995, 1996 Hewlett-Packard Company.
  3.  
  4. package jgl;
  5.  
  6. /**
  7.  * LogicalOr is a binary predicate that returns true if either operand is equal to 
  8.  * Boolean.TRUE.
  9.  * <p>
  10.  * @see jgl.LogicalAnd
  11.  * @version 1.1
  12.  * @author ObjectSpace, Inc.
  13.  */
  14.  
  15. public final class LogicalOr implements BinaryPredicate
  16.   {
  17.   /**
  18.    * Perform a logical OR.
  19.    * @param first The first operand, which must be an instance of Boolean.
  20.    * @param second The second operand, which must be an instance of Boolean.
  21.    * @return true if either operand is equal to Boolean.TRUE.
  22.    */
  23.   public boolean execute( Object first, Object second )
  24.     {
  25.     return ((Boolean) first).booleanValue() || ((Boolean) second).booleanValue();
  26.     }
  27.   }
  28.