home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / jgl_1_1 / jgl_1_1.exe / src / GreaterEqualInteger.java < prev    next >
Encoding:
Java Source  |  1996-09-10  |  900 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.  * GreaterEqualInteger is a binary predicate that assumes that both of its operands are
  8.  * instances of Integer and returns true if the first operand is greater than or equal to the 
  9.  * second operand.
  10.  * <p>
  11.  * @version 1.1
  12.  * @author ObjectSpace, Inc.
  13.  */
  14.  
  15. public final class GreaterEqualInteger implements BinaryPredicate
  16.   {
  17.   /**
  18.    * Return true if the first operand is greater than or equal to the second operand.
  19.    * @param first The first operand, which must be an instance of Integer.
  20.    * @param second The second operand, which must be an instance of Integer.
  21.    * @return first >= second
  22.    */
  23.   public boolean execute( Object first, Object second )
  24.     {
  25.     return ((Integer) first).intValue() >= ((Integer) second).intValue();
  26.     }
  27.   }
  28.