This class represents a converter adding a constant offset to numeric values (double based).
| Modifier and Type | Field and Description |
|---|---|
| private final Number | offset
Holds the offset. |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | AddConverter(Number
the offset value. offset)Creates an additive converter having the specified offset. |
| 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. |
| 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 Number | |
| public Number | |
| public int | hashCode()
Implements abstract tech. Returns a hash code value for this object. |
| public AddConverter | 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. |
| public boolean | isLinear()
Implements javax. Indicates whether this converter represents a (one-dimensional) linear transformation, that is a linear map (wikipedia) from a one-dimensional vector space (a scalar) to a one-dimensional vector space. |
| protected AbstractConverter | reduce(AbstractConverter that)
Overrides tech. Non-API
Guarded by |
| public String | transformationLiteral()
Implements abstract tech. Non-API Returns a String describing the transformation that is represented by this converter. |
| offset | back to summary |
|---|---|
| private final Number offset Holds the offset. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides tech. | |
| AddConverter | back to summary |
|---|---|
| public AddConverter(Number offset) Creates an additive converter having the specified offset.
| |
| 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
| |
| 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. | |
| getOffset | back to summary |
|---|---|
| public Number getOffset() Returns the offset value for this add 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 |
|---|---|
| public AddConverter 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
| |
| isLinear | back to summary |
|---|---|
| public boolean isLinear() Implements javax. Doc from javax. Indicates whether this converter represents a (one-dimensional) linear transformation, that is a linear map (wikipedia) from a one-dimensional vector space (a scalar) to a one-dimensional vector space. Typically from 'R' to 'R', with 'R' the real numbers. Given such a 'linear' converter 'A', let 'u', 'v' and 'r' be arbitrary numbers, then the following must hold by definition:
Given a second 'linear' converter 'B', commutativity of composition follows by above definition:
A(B(u)) == B(A(u)), meaning
for 'A' and 'B' the order of their composition does not matter. Expressed as Java code:
UnitConverter#concatenate(UnitConverter).
| |
| reduce | back to summary |
|---|---|
| protected AbstractConverter reduce(AbstractConverter that) Overrides tech. Doc from tech. Non-API
Guarded by
| |
| transformationLiteral | back to summary |
|---|---|
| public 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
| |