home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Extras / OSpace / jgl.exe / jgl_2_0 / src / COM / objectspace / jgl / BinaryNot.java < prev    next >
Encoding:
Java Source  |  1997-03-14  |  1.0 KB  |  40 lines

  1. // Copyright(c) 1996,1997 ObjectSpace, Inc.
  2. // Portions Copyright(c) 1995, 1996 Hewlett-Packard Company.
  3.  
  4. package COM.objectspace.jgl;
  5.  
  6. /**
  7.  * BinaryNot is a binary predicate that returns true if the result of executing
  8.  * a binary predicate on its operands is false.
  9.  * <p>
  10.  * @see COM.objectspace.jgl.UnaryNot
  11.  * @version 2.0.2
  12.  * @author ObjectSpace, Inc.
  13.  */
  14.  
  15. public final class BinaryNot implements BinaryPredicate
  16.   {
  17.   BinaryPredicate myPredicate;
  18.  
  19.   /**
  20.    * Construct myself with a single binary predicate object.
  21.    * @param predicate The binary predicate object.
  22.    */
  23.   public BinaryNot( BinaryPredicate predicate )
  24.     {
  25.     myPredicate = predicate;
  26.     }
  27.  
  28.   /**
  29.    * Perform my binary predicate on the operands and return true if the predicate
  30.    * returns false.
  31.    * @param first The first operand.
  32.    * @param second The second operand.
  33.    * @return !function( first, second )
  34.    */
  35.   public boolean execute( Object first, Object second )
  36.     {
  37.     return !myPredicate.execute( first, second );
  38.     }
  39.   }
  40.