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 / LengthString.java < prev    next >
Encoding:
Java Source  |  1997-03-14  |  642 b   |  26 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.  * LengthString is a unary function that returns the length of
  8.  * its operand as a string.
  9.  * <p>
  10.  * @version 2.0.2
  11.  * @author ObjectSpace, Inc.
  12.  */
  13.  
  14. public final class LengthString implements UnaryFunction
  15.   {
  16.   /**
  17.    * Return the length of my operand's string as an Integer.
  18.    * @param object The operand
  19.    * @return The length of the operand.toString().
  20.    */
  21.   public Object execute( Object object )
  22.     {
  23.     return new Integer( object.toString().length() );
  24.     }
  25.   }
  26.