home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / jgl_1_1 / jgl_1_1.exe / src / LessEqualString.java < prev    next >
Encoding:
Java Source  |  1996-09-10  |  713 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.  * LessEqualString is a binary predicate that
  8.  * returns true if the first operand as a string is less 
  9.  * than or equal to the second operand as a string.
  10.  * <p>
  11.  * @version 1.1
  12.  * @author ObjectSpace, Inc.
  13.  */
  14.  
  15. public final class LessEqualString implements BinaryPredicate
  16.   {
  17.   /**
  18.    * Return true if the first operand is less than or 
  19.    * equal to the second operand.
  20.    * @return first.toString() <= second.toString()
  21.    */
  22.   public boolean execute( Object first, Object second )
  23.     {
  24.     return first.toString().compareTo( second.toString() ) <= 0;
  25.     }
  26.   }
  27.