All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.functions.NegateNumber

java.lang.Object
   |
   +----COM.objectspace.jgl.functions.NegateNumber

public final class NegateNumber
extends Object
implements UnaryFunction
NegateNumber is a binary function that assumes its operand is an instance of Number and returns its negation.

See Also:
Number, BigInteger, BigDecimal

Constructor Index

 o NegateNumber()
Construct myself to use intValue() for operation.
 o NegateNumber(Class)
Construct myself to operate on objects of the given class.

Method Index

 o execute(Object)
Return the negation of my operand.

Constructors

 o NegateNumber
 public NegateNumber()
Construct myself to use intValue() for operation.

 o NegateNumber
 public NegateNumber(Class discriminator)
Construct myself to operate on objects of the given class. The class must be derived from java.lang.Number.

Parameters:
discriminator - The class of objects on which I will be operating.
Throws: IllegalArgumentException
Throw if discriminator is not an instance of java.lang.Number.

Methods

 o execute
 public Object execute(Object object)
Return the negation of my operand. Be aware that some floating point conversions are not exact, and may cause unexpected results due to rounding.

Parameters:
object - The operand, which must be an instance of Number.
Returns:
-object
Throws: InvalidOperationException
Throw if I don't know how to interpret the values.

All Packages  Class Hierarchy  This Package  Previous  Next  Index