All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.roguewave.money.currency.v1_0.DoubleValue

java.lang.Object
   |
   +----com.roguewave.money.currency.v1_0.DoubleValue

public class DoubleValue
extends Object
implements Value
DoubleValue class encapsulates a primitive double. This class provides the exact same functionality as the double but exists to that BigDecimalValue and DoubleValue can have identical interfaces. That common interface is Value

DoubleValue provides less accuracy than BigDecimalValue but exhibits much better performance.

Author:
Trevor Misfeldt
See Also:
BigDecimalValue, Value

Constructor Index

 o DoubleValue(double)
Creates a new DoubleValue with the underlying floating-point number.

Method Index

 o abs()
Returns a new value object which has the absolute value of this value.
 o compare(Value)
Compares this value with the specified value.
 o equals(Value)
Returns true if the two values are equal.
 o getValue()
Returns the underlying floating-point double.
 o greaterThan(Value)
Returns true if this value is greater than the specified value.
 o greaterThanOrEqual(Value)
Returns true if this value is greater than or equal to the specified value.
 o greaterThanZero()
Returns true if this value is greater than zero.
 o isZero()
Returns true if this value is equal to zero.
 o lessThan(Value)
Returns true if this value is less than the specified value.
 o lessThanOrEqual(Value)
Returns true if this value is less than or equal to the specified value.
 o lessThanZero()
Returns true if this value is less than zero.
 o minus(Value)
Returns a value object which has an underlying value equal to the difference between this value and the specified value.
 o negate()
Returns a new value object which has the negation of this value.
 o notEquals(Value)
Returns true if the two values are not equal.
 o over(Value)
Returns a value object which has an underlying value equal to this value divided by the specified value.
 o plus(Value)
Returns a value object which has an underlying value equal to the sum of the this value and the specified value.
 o round(int, short, int)
Rounds this value and returns it in a new value object.
 o setValue(double)
Sets the underlying floating-point value.
 o times(Value)
Returns a value object which has an underlying value equal to the product between this value and the specified value.
 o toString()
Returns a string representation of the encapsulated value.

Constructors

 o DoubleValue
 public DoubleValue(double value)
Creates a new DoubleValue with the underlying floating-point number.

Parameters:
value - the desired value

Methods

 o getValue
 public double getValue()
Returns the underlying floating-point double.

Returns:
the value
 o setValue
 public void setValue(double value)
Sets the underlying floating-point value.

Parameters:
value - the desired value
 o plus
 public Value plus(Value value)
Returns a value object which has an underlying value equal to the sum of the this value and the specified value.

Parameters:
value - the operand
Returns:
the sum
 o minus
 public Value minus(Value value)
Returns a value object which has an underlying value equal to the difference between this value and the specified value.

Parameters:
value - the operand
Returns:
the difference
 o times
 public Value times(Value value)
Returns a value object which has an underlying value equal to the product between this value and the specified value.

Parameters:
value - the operand
Returns:
the product
 o over
 public Value over(Value value)
Returns a value object which has an underlying value equal to this value divided by the specified value.

Parameters:
value - the divisor
Returns:
the quotient
 o equals
 public boolean equals(Value value)
Returns true if the two values are equal. False, otherwise.

Parameters:
value - the value for comparison
Returns:
whether the two values are equal or not
 o notEquals
 public boolean notEquals(Value value)
Returns true if the two values are not equal. False, otherwise.

Parameters:
value - the value for comparison
Returns:
whether the two values are not equal
 o lessThan
 public boolean lessThan(Value value)
Returns true if this value is less than the specified value. False, otherwise.

Parameters:
value - the value for comparison
Returns:
whether this value is less than the specified value
 o greaterThan
 public boolean greaterThan(Value value)
Returns true if this value is greater than the specified value. False, otherwise.

Parameters:
value - the value for comparison
Returns:
whether this value is greater than the specified value
 o lessThanOrEqual
 public boolean lessThanOrEqual(Value value)
Returns true if this value is less than or equal to the specified value. False, otherwise. Precisions are ignored.

Parameters:
value - the value for comparison
Returns:
whether this value is less than or equal to the specified value
 o greaterThanOrEqual
 public boolean greaterThanOrEqual(Value value)
Returns true if this value is greater than or equal to the specified value. False, otherwise. Precisions are ignored.

Parameters:
value - the value for comparison
Returns:
whether this value is greater than or equal to the specified value
 o isZero
 public boolean isZero()
Returns true if this value is equal to zero. False, otherwise.

Parameters:
value - the value for comparison
Returns:
whether this value is zero
 o lessThanZero
 public boolean lessThanZero()
Returns true if this value is less than zero. False, otherwise.

Parameters:
value - the value for comparison
Returns:
whether this value is less than zero
 o greaterThanZero
 public boolean greaterThanZero()
Returns true if this value is greater than zero. False, otherwise.

Parameters:
value - the value for comparison
Returns:
whether this value is greater than zero
 o compare
 public int compare(Value value)
Compares this value with the specified value.

Parameters:
the - value to compare
Returns:
-1 if this value is less than the specified value, 0 if they are equal, or 1 if this value is greater
 o abs
 public Value abs()
Returns a new value object which has the absolute value of this value.

Returns:
the absolute value
 o negate
 public Value negate()
Returns a new value object which has the negation of this value.

Returns:
the negation
 o round
 public Value round(int accuracy,
                    short rounding,
                    int digit)
Rounds this value and returns it in a new value object.

Parameters:
accuracy - The desired digits after the decimal point.
rounding - the desired rounding method
digit - the desired digit to round on. For example, '5'.
Returns:
the rounded value
See Also:
NO_ROUND, ROUND_UP, ROUND_DOWN, ROUND_PLAIN, ROUND_BANKERS
 o toString
 public String toString()
Returns a string representation of the encapsulated value.

Returns:
the value as a string
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index