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

  1. // Copyright(c) 1996 ObjectSpace, Inc.
  2. // Portions Copyright(c) 1995, 1996 Hewlett-Packard Company.
  3.  
  4. package jgl;
  5.  
  6. /**
  7.  * LessInteger is a binary predicate that assumes that both of its operands are
  8.  * instances of Integer and returns true if the first operand is less than the second operand.
  9.  * <p>
  10.  * @version 1.1
  11.  * @author ObjectSpace, Inc.
  12.  */
  13.  
  14. public class LessInteger implements BinaryPredicate
  15.   {
  16.   /**
  17.    * Return true if the first operand is less than the second operand.
  18.    * @param first The first operand, which must be an instance of Integer.
  19.    * @param second The second operand, which must be an instance of Integer.
  20.    * @return first < second
  21.    */
  22.   public boolean execute( Object first, Object second )
  23.     {
  24.     return ((Integer) first).intValue() < ((Integer) second).intValue();
  25.     }
  26.   }
  27.