public final class Multipliable14f extends Object
Multipliable14f encapsulates a Decimal of scale 14 and facilitates
exact typed multiplication. The multipliable object acts as first factor in the multiplication
and provides a set of overloaded methods for different scales. Each one of those methods
delivers a different result scale which represents the appropriate scale for the product of
an exact multiplication.
A Multipliable14f object is returned by Decimal14f.multiplyExact(),
hence an exact typed multiplication can be written as:
Decimal14f value = ... //some value Decimal16f product = value.multiplyExact().by(Decimal2f.FIVE);
| Constructor and Description |
|---|
Multipliable14f(Decimal<Scale14f> value)
Constructor with Decimal value to be encapsulated.
|
| Modifier and Type | Method and Description |
|---|---|
Decimal14f |
by(Decimal0f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal15f |
by(Decimal1f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal16f |
by(Decimal2f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal17f |
by(Decimal3f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal18f |
by(Decimal4f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal14f |
by(MutableDecimal0f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal15f |
by(MutableDecimal1f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal16f |
by(MutableDecimal2f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal17f |
by(MutableDecimal3f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal18f |
by(MutableDecimal4f factor)
Returns a
Decimal whose value is (this * factor). |
boolean |
equals(Object obj)
Compares this Multipliable14f to the specified object.
|
Decimal<Scale14f> |
getValue()
Returns the value underlying this Multipliable14f.
|
int |
hashCode()
Returns a hash code for this
Multipliable14f which happens to be the
hash code of the underlying Decimal14f value. |
String |
toString()
Returns a string representation of this
Multipliable14f which is
simply the string representation of the underlying Decimal value. |
public Multipliable14f(Decimal<Scale14f> value)
value - the decimal value to be wrapped as a multipliable objectpublic Decimal<Scale14f> getValue()
public Decimal14f by(Decimal0f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 14 which is the sum of the scales
of the Decimal that this multipliable object represents and the scale of
the factor argument. An ArithmeticException is thrown if the
product is out of the possible range for a Decimal14f.
Note that the result is always a new instance.
factor - the factor to multiply with the Decimal that this multipliable represents(this * factor)ArithmeticException - if an overflow occurs and product is out of the possible
range for a Decimal14fpublic Decimal14f by(MutableDecimal0f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 14 which is the sum of the scales
of the Decimal that this multipliable object represents and the scale of
the factor argument. An ArithmeticException is thrown if the
product is out of the possible range for a Decimal14f.
Note that the result is always a new instance.
factor - the factor to multiply with the Decimal that this multipliable represents(this * factor)ArithmeticException - if an overflow occurs and product is out of the possible
range for a Decimal14fpublic Decimal15f by(Decimal1f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 15 which is the sum of the scales
of the Decimal that this multipliable object represents and the scale of
the factor argument. An ArithmeticException is thrown if the
product is out of the possible range for a Decimal15f.
Note that the result is always a new instance.
factor - the factor to multiply with the Decimal that this multipliable represents(this * factor)ArithmeticException - if an overflow occurs and product is out of the possible
range for a Decimal15fpublic Decimal15f by(MutableDecimal1f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 15 which is the sum of the scales
of the Decimal that this multipliable object represents and the scale of
the factor argument. An ArithmeticException is thrown if the
product is out of the possible range for a Decimal15f.
Note that the result is always a new instance.
factor - the factor to multiply with the Decimal that this multipliable represents(this * factor)ArithmeticException - if an overflow occurs and product is out of the possible
range for a Decimal15fpublic Decimal16f by(Decimal2f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 16 which is the sum of the scales
of the Decimal that this multipliable object represents and the scale of
the factor argument. An ArithmeticException is thrown if the
product is out of the possible range for a Decimal16f.
Note that the result is always a new instance.
factor - the factor to multiply with the Decimal that this multipliable represents(this * factor)ArithmeticException - if an overflow occurs and product is out of the possible
range for a Decimal16fpublic Decimal16f by(MutableDecimal2f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 16 which is the sum of the scales
of the Decimal that this multipliable object represents and the scale of
the factor argument. An ArithmeticException is thrown if the
product is out of the possible range for a Decimal16f.
Note that the result is always a new instance.
factor - the factor to multiply with the Decimal that this multipliable represents(this * factor)ArithmeticException - if an overflow occurs and product is out of the possible
range for a Decimal16fpublic Decimal17f by(Decimal3f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 17 which is the sum of the scales
of the Decimal that this multipliable object represents and the scale of
the factor argument. An ArithmeticException is thrown if the
product is out of the possible range for a Decimal17f.
Note that the result is always a new instance.
factor - the factor to multiply with the Decimal that this multipliable represents(this * factor)ArithmeticException - if an overflow occurs and product is out of the possible
range for a Decimal17fpublic Decimal17f by(MutableDecimal3f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 17 which is the sum of the scales
of the Decimal that this multipliable object represents and the scale of
the factor argument. An ArithmeticException is thrown if the
product is out of the possible range for a Decimal17f.
Note that the result is always a new instance.
factor - the factor to multiply with the Decimal that this multipliable represents(this * factor)ArithmeticException - if an overflow occurs and product is out of the possible
range for a Decimal17fpublic Decimal18f by(Decimal4f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 18 which is the sum of the scales
of the Decimal that this multipliable object represents and the scale of
the factor argument. An ArithmeticException is thrown if the
product is out of the possible range for a Decimal18f.
Note that the result is always a new instance.
factor - the factor to multiply with the Decimal that this multipliable represents(this * factor)ArithmeticException - if an overflow occurs and product is out of the possible
range for a Decimal18fpublic Decimal18f by(MutableDecimal4f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 18 which is the sum of the scales
of the Decimal that this multipliable object represents and the scale of
the factor argument. An ArithmeticException is thrown if the
product is out of the possible range for a Decimal18f.
Note that the result is always a new instance.
factor - the factor to multiply with the Decimal that this multipliable represents(this * factor)ArithmeticException - if an overflow occurs and product is out of the possible
range for a Decimal18fpublic int hashCode()
Multipliable14f which happens to be the
hash code of the underlying Decimal14f value.hashCode in class ObjectDecimal.hashCode()public boolean equals(Object obj)
true
if and only if the argument is a Multipliable14f with an equal underlying
value.equals in class Objectobj - the object to compare withtrue if the argument is a Multipliable14f and if its value
is equal to this multipliables's value; false otherwisegetValue(),
Decimal.equals(Object)public String toString()
Multipliable14f which is
simply the string representation of the underlying Decimal value.toString in class ObjectString Decimal representation of this Multipliable14f's
value with all the fraction digits (including trailing zeros)getValue(),
Decimal.toString()