public final class Multipliable9f extends Object
Multipliable9f encapsulates a Decimal of scale 9 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 Multipliable9f object is returned by Decimal9f.multiplyExact(),
hence an exact typed multiplication can be written as:
Decimal9f value = ... //some value Decimal11f product = value.multiplyExact().by(Decimal2f.FIVE);
| Constructor and Description |
|---|
Multipliable9f(Decimal<Scale9f> value)
Constructor with Decimal value to be encapsulated.
|
| Modifier and Type | Method and Description |
|---|---|
Decimal18f |
by(Decimal<Scale9f> factor)
Returns a
Decimal whose value is (this * factor). |
Decimal9f |
by(Decimal0f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal10f |
by(Decimal1f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal11f |
by(Decimal2f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal12f |
by(Decimal3f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal13f |
by(Decimal4f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal14f |
by(Decimal5f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal15f |
by(Decimal6f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal16f |
by(Decimal7f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal17f |
by(Decimal8f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal9f |
by(MutableDecimal0f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal10f |
by(MutableDecimal1f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal11f |
by(MutableDecimal2f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal12f |
by(MutableDecimal3f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal13f |
by(MutableDecimal4f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal14f |
by(MutableDecimal5f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal15f |
by(MutableDecimal6f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal16f |
by(MutableDecimal7f factor)
Returns a
Decimal whose value is (this * factor). |
Decimal17f |
by(MutableDecimal8f factor)
Returns a
Decimal whose value is (this * factor). |
boolean |
equals(Object obj)
Compares this Multipliable9f to the specified object.
|
Decimal<Scale9f> |
getValue()
Returns the value underlying this Multipliable9f.
|
int |
hashCode()
Returns a hash code for this
Multipliable9f which happens to be the
hash code of the underlying Decimal9f value. |
Decimal18f |
square()
Returns a
Decimal whose value is (this2). |
String |
toString()
Returns a string representation of this
Multipliable9f which is
simply the string representation of the underlying Decimal value. |
public Multipliable9f(Decimal<Scale9f> value)
value - the decimal value to be wrapped as a multipliable objectpublic Decimal<Scale9f> getValue()
public Decimal18f square()
Decimal whose value is (this2). The
result is exact and has scale 18 which is twice the scale of
the Decimal that this multipliable object represents. 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.
(this * this)ArithmeticException - if an overflow occurs and product is out of the possible
range for a Decimal18fpublic Decimal18f by(Decimal<Scale9f> 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 Decimal9f by(Decimal0f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 9 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 Decimal9f.
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 Decimal9fpublic Decimal9f by(MutableDecimal0f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 9 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 Decimal9f.
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 Decimal9fpublic Decimal10f by(Decimal1f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 10 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 Decimal10f.
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 Decimal10fpublic Decimal10f by(MutableDecimal1f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 10 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 Decimal10f.
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 Decimal10fpublic Decimal11f by(Decimal2f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 11 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 Decimal11f.
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 Decimal11fpublic Decimal11f by(MutableDecimal2f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 11 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 Decimal11f.
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 Decimal11fpublic Decimal12f by(Decimal3f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 12 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 Decimal12f.
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 Decimal12fpublic Decimal12f by(MutableDecimal3f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 12 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 Decimal12f.
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 Decimal12fpublic Decimal13f by(Decimal4f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 13 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 Decimal13f.
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 Decimal13fpublic Decimal13f by(MutableDecimal4f factor)
Decimal whose value is (this * factor). The
result is exact and has scale 13 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 Decimal13f.
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 Decimal13fpublic Decimal14f by(Decimal5f 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(MutableDecimal5f 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(Decimal6f 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(MutableDecimal6f 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(Decimal7f 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(MutableDecimal7f 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(Decimal8f 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(MutableDecimal8f 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 int hashCode()
Multipliable9f which happens to be the
hash code of the underlying Decimal9f value.hashCode in class ObjectDecimal.hashCode()public boolean equals(Object obj)
true
if and only if the argument is a Multipliable9f with an equal underlying
value.equals in class Objectobj - the object to compare withtrue if the argument is a Multipliable9f and if its value
is equal to this multipliables's value; false otherwisegetValue(),
Decimal.equals(Object)public String toString()
Multipliable9f which is
simply the string representation of the underlying Decimal value.toString in class ObjectString Decimal representation of this Multipliable9f's
value with all the fraction digits (including trailing zeros)getValue(),
Decimal.toString()