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

  1. // Copyright(c) 1996 ObjectSpace, Inc.
  2. // Portions Copyright(c) 1995, 1996 Hewlett-Packard Company.
  3.  
  4. package 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 1.1
  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.    * @return first.toString() > second.toString()
  20.    */
  21.   public boolean execute( Object first, Object second )
  22.     {
  23.     return first.toString().compareTo( second.toString() ) > 0;
  24.     }
  25.   }
  26.