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