All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.DividesNumber

java.lang.Object
   |
   +----COM.objectspace.jgl.DividesNumber

public final class DividesNumber
extends Object
implements BinaryFunction
DividesNumber is a binary function that assumes that both of its operands are instances of Number and returns the first operand divided by the second operand.

Version:
2.0.2
Author:
ObjectSpace, Inc.
See Also:
Number, BigInteger, BigDecimal

Constructor Index

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

Method Index

 o execute(Object, Object)
Return the result of dividing the first operand by the second operand.

Constructors

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

 o DividesNumber
 public DividesNumber(Class discriminator)
Construct myself to operate on objects of the given class. The class must be derived from java.lang.Number. If the discriminating class is java.math.BigDecimal, use ROUND_DOWN as the rounding mode.

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.
See Also:
BigDecimal
 o DividesNumber
 public DividesNumber(Class discriminator,
                      int rounding)
Construct myself to operate on objects of the given class. The class must be derived from java.lang.Number. If the class is an instance of java.math.BigDecimal, use the given rounding mode.

Parameters:
discriminator - The class of objects on which I will be operating.
rounding - The specified rounding mode. Only used when the discriminator is a java.math.BigDecimal.
Throws: IllegalArgumentException
Throw if discriminator is not an instance of java.lang.Number.
See Also:
divide

Methods

 o execute
 public Object execute(Object first,
                       Object second)
Return the result of dividing the first operand by the second operand. Be aware that some floating point conversions are not exact, and may cause unexpected results due to rounding.

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

All Packages  Class Hierarchy  This Package  Previous  Next  Index