All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.roguewave.money.currency.v1_0.Value

public interface Value
The interface Value is the parent of DoubleValue and BigDecimalValue. These two classes represent a fundamental choice for the Money.h++ user. One can either choose floating-point arithmetic or decimal arithmetic. The trade-off is that floating-point values offer much greater performance. However, the decimal values provide perfect precision (or at least perfect precision with error-handling).

Author:
Trevor Misfeldt
See Also:
BigDecimalValue, DoubleValue

Method Index

 o abs()
Returns the absolute value of this value in a new value object.
 o compare(Value)
Compares this value with the specified value.
 o equals(Value)
Returns true if the two values are equal.
 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 positive.
 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 negative.
 o minus(Value)
Subtracts the specified value from this value and returns it in a new value object.
 o negate()
Returns the negation of this value in a new value object.
 o notEquals(Value)
Returns true if the two values are not equal.
 o over(Value)
Divides this value by the specified value and returns it in a new value object.
 o plus(Value)
Adds the specified value to this value and returns it in a new value object.
 o round(int, short, int)
Rounds this value and returns it in a new value object.
 o times(Value)
Multiplies the specified value with this value and returns it in a new value object.
 o toString()
Returns a string representation of the encapsulated value.

Methods

 o plus
 public abstract Value plus(Value value)
Adds the specified value to this value and returns it in a new value object.

Parameters:
value - the operand
See Also:
plus, plus
 o minus
 public abstract Value minus(Value value)
Subtracts the specified value from this value and returns it in a new value object.

Parameters:
value - the operand
Returns:
the difference
See Also:
minus, minus
 o times
 public abstract Value times(Value value)
Multiplies the specified value with this value and returns it in a new value object.

Parameters:
value - the operand
Returns:
the product
See Also:
times, times
 o over
 public abstract Value over(Value value)
Divides this value by the specified value and returns it in a new value object.

Parameters:
value - the divisor
Returns:
the quotient
See Also:
over, over
 o equals
 public abstract 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
See Also:
equals, equals
 o notEquals
 public abstract 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
See Also:
notEquals, notEquals
 o lessThan
 public abstract boolean lessThan(Value value)
Returns true if this value is less than the specified value.

Parameters:
value - the value for comparison
Returns:
whether this value is less than the specified value or not.
See Also:
lessThan, lessThan
 o greaterThan
 public abstract boolean greaterThan(Value value)
Returns true if this value is greater than the specified value.

Parameters:
value - the value for comparison
Returns:
whether this value is greater than the specified value or not.
See Also:
greaterThan, greaterThan
 o lessThanOrEqual
 public abstract boolean lessThanOrEqual(Value value)
Returns true if this value is less than or equal to the specified value.

Parameters:
value - the value for comparison
Returns:
whether this value is less than or equal to the specified value or not.
See Also:
lessThanOrEqual, lessThanOrEqual
 o greaterThanOrEqual
 public abstract boolean greaterThanOrEqual(Value value)
Returns true if this value is greater than or equal to the specified value.

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

Returns:
whether this value is zero or not.
See Also:
isZero, isZero
 o lessThanZero
 public abstract boolean lessThanZero()
Returns true if this value is negative.

Returns:
whether this value is less than zero or not.
See Also:
lessThanZero, lessThanZero
 o greaterThanZero
 public abstract boolean greaterThanZero()
Returns true if this value is positive.

Returns:
whether this value is greater than zero or not.
See Also:
greaterThanZero, greaterThanZero
 o compare
 public abstract 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 specifiec value, 0 if they are equal, or 1 if this value is greater
See Also:
compare, compare
 o abs
 public abstract Value abs()
Returns the absolute value of this value in a new value object.

Returns:
the absolute value
See Also:
abs, abs
 o negate
 public abstract Value negate()
Returns the negation of this value in a new value object. In other words, it returns -1 times this value.

Returns:
the negation
See Also:
negate, negate
 o round
 public abstract 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 abstract 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