| JGL - The Generic Collection Library for Java |
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
-
NegateNumber()
- Construct myself to use intValue() for operation.
-
NegateNumber(Class)
- Construct myself to operate on objects of the given class.
-
execute(Object)
- Return the negation of my operand.
NegateNumber
public NegateNumber()
- Construct myself to use intValue() for operation.
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.
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