This class represents a converter multiplying numeric values by an exact scaling factor (represented as the quotient of two BigInteger
numbers).
| Modifier and Type | Field and Description |
|---|---|
| private final RationalNumber | factor
Holds the scale factor. |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv | RationalConverter(RationalNumber
the scale factor. factor)Creates a rational converter with the specified scale factor. |
| pack-priv | RationalConverter(BigInteger
the dividend. dividend, BigInteger the non-zero divisor. divisor)Creates a rational converter with the specified dividend and divisor. |
| pack-priv | RationalConverter(long
the dividend. dividend, long the positive divisor. divisor)Convenience method equivalent to |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | canReduceWith(AbstractConverter that)
Implements abstract tech. Non-API
Guard for |
| public int | compareTo(UnitConverter
the object to be compared. o)Implements java. Compares this object with the specified object for order. |
| private AbstractConverter | |
| protected Number | convertWhenNotIdentity(Number value)
Implements abstract tech. Non-API |
| public boolean | equals(Object
the reference object with which to compare. obj)Implements abstract tech. Indicates whether some other object is "equal to" this one. |
| public double | |
| public BigInteger | Returns: this converter dividend.Returns the integer dividend for this rational converter. |
| public BigInteger | Returns: this converter divisor.Returns the integer (positive) divisor for this rational converter. |
| public Number | |
| public int | hashCode()
Implements abstract tech. Returns a hash code value for this object. |
| protected RationalConverter | inverseWhenNotIdentity()
Implements abstract tech. Non-API Returns an AbstractConverter that represents the inverse transformation of this converter, for cases where the transformation is not the identity transformation. |
| public boolean | isIdentity()
Implements javax. Indicates if this converter is an identity converter. |
| pack-priv static RationalConverter | of(RationalNumber
the scale factor. factor)Creates a rational converter with the specified scale factor. |
| pack-priv static RationalConverter | of(BigInteger
the dividend. dividend, BigInteger the positive divisor. divisor)Convenience method equivalent to |
| pack-priv static RationalConverter | of(long
the dividend. dividend, long the positive divisor. divisor)Convenience method equivalent to |
| protected AbstractConverter | reduce(AbstractConverter that)
Overrides tech. Non-API
Guarded by |
| protected final String | transformationLiteral()
Implements abstract tech. Non-API Returns a String describing the transformation that is represented by this converter. |
| factor | back to summary |
|---|---|
| private final RationalNumber factor Holds the scale factor. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides tech. | |
| RationalConverter | back to summary |
|---|---|
| pack-priv RationalConverter(RationalNumber factor) Creates a rational converter with the specified scale factor.
| |
| RationalConverter | back to summary |
|---|---|
| pack-priv RationalConverter(BigInteger dividend, BigInteger divisor) Creates a rational converter with the specified dividend and divisor.
| |
| RationalConverter | back to summary |
|---|---|
| pack-priv RationalConverter(long dividend, long divisor) Convenience method equivalent to
| |
| canReduceWith | back to summary |
|---|---|
| protected boolean canReduceWith(AbstractConverter that) Implements abstract tech. Doc from tech. Non-API
Guard for
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(UnitConverter o) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| composeSameType | back to summary |
|---|---|
| private AbstractConverter composeSameType(RationalConverter that) | |
| convertWhenNotIdentity | back to summary |
|---|---|
| protected Number convertWhenNotIdentity(Number value) Implements abstract tech. Doc from tech. Non-API | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Implements abstract tech. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getAsDouble | back to summary |
|---|---|
| public double getAsDouble() Implements java. Doc from java. Gets a result.
| |
| getDividend | back to summary |
|---|---|
| public BigInteger getDividend() Returns the integer dividend for this rational converter.
| |
| getDivisor | back to summary |
|---|---|
| public BigInteger getDivisor() Returns the integer (positive) divisor for this rational converter.
| |
| getValue | back to summary |
|---|---|
| public Number getValue() Implements tech. Doc from tech. Gets a value. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract tech. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| inverseWhenNotIdentity | back to summary |
|---|---|
| protected RationalConverter inverseWhenNotIdentity() Implements abstract tech. Doc from tech. Non-API Returns an AbstractConverter that represents the inverse transformation of this converter, for cases where the transformation is not the identity transformation.
| |
| isIdentity | back to summary |
|---|---|
| public boolean isIdentity() Implements javax. Doc from javax. Indicates if this converter is an identity converter. The identity converter returns its input argument ( Note Identity converters are also always 'linear', see
| |
| of | back to summary |
|---|---|
| pack-priv static RationalConverter of(RationalNumber factor) Creates a rational converter with the specified scale factor.
| |
| of | back to summary |
|---|---|
| pack-priv static RationalConverter of(BigInteger dividend, BigInteger divisor) Convenience method equivalent to
| |
| of | back to summary |
|---|---|
| pack-priv static RationalConverter of(long dividend, long divisor) Convenience method equivalent to
| |
| reduce | back to summary |
|---|---|
| protected AbstractConverter reduce(AbstractConverter that) Overrides tech. Doc from tech. Non-API
Guarded by
| |
| transformationLiteral | back to summary |
|---|---|
| protected final String transformationLiteral() Implements abstract tech. Doc from tech. Non-API
Returns a String describing the transformation that is represented by this converter.
Contributes to converter's
| |