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 / NegateInteger.java < prev    next >
Encoding:
Java Source  |  1997-03-14  |  731 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.  * NegateInteger is a unary function object that assumes that its operand is an instance of
  8.  * Integer and returns its negation.
  9.  * <p>
  10.  * @version 2.0.2
  11.  * @author ObjectSpace, Inc.
  12.  * @deprecated
  13.  * @see COM.objectspace.jgl.NegateNumber
  14.  */
  15.  
  16. public final class NegateInteger implements UnaryFunction
  17.   {
  18.   /**
  19.    * Return the negation of my operand.
  20.    * @param object The operand, which must be an instance of Integer.
  21.    * @return -object
  22.    */
  23.   public Object execute( Object object )
  24.     {
  25.     return new Integer( -((Integer) object).intValue() );
  26.     }
  27.   }
  28.