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

  1. // Copyright(c) 1996 ObjectSpace, Inc.
  2. // Portions Copyright(c) 1995, 1996 Hewlett-Packard Company.
  3.  
  4. package jgl;
  5.  
  6. /**
  7.  * LogicalNot is a unary predicate that returns true if its operand is equal to false.
  8.  * <p>
  9.  * @version 1.1
  10.  * @author ObjectSpace, Inc.
  11.  */
  12.  
  13. public final class LogicalNot implements UnaryPredicate
  14.   {
  15.   /**
  16.    * Perform a logical NOT.
  17.    * @param object The operand, which must be an instance of Boolean.
  18.    * @return true if the operand is equal to Boolean.FALSE.
  19.    */
  20.   public boolean execute( Object object )
  21.     {
  22.     return !((Boolean) object).booleanValue();
  23.     }
  24.   }
  25.