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 / GreaterString.java < prev    next >
Encoding:
Java Source  |  1997-03-14  |  876 b   |  28 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.  * GreaterString is a binary predicate that
  8.  * returns true if the first operand as a string
  9.  * is greater than the second operand as a string.
  10.  * <p>
  11.  * @version 2.0.2
  12.  * @author ObjectSpace, Inc.
  13.  */
  14.  
  15. public final class GreaterString implements BinaryPredicate
  16.   {
  17.   /**
  18.    * Return true if the first operand is greater than the second operand.
  19.    * @param first The first operand, which is converted into a String if necessary.
  20.    * @param second The second operand, which is converted into a String if necessary.
  21.    * @return first.toString() > second.toString()
  22.    */
  23.   public boolean execute( Object first, Object second )
  24.     {
  25.     return first.toString().compareTo( second.toString() ) > 0;
  26.     }
  27.   }
  28.