|
Java Units API Build 2004-02-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectConverter
AddConverter
This class represents an add converter. An add converter adds a constant offset to numeric values.
Instances of this class are immutable.
Field Summary |
Fields inherited from class Converter |
IDENTITY |
Constructor Summary | |
AddConverter(double offset)
Creates an add converter with the specified offset. |
Method Summary | |
Converter |
concatenate(Converter converter)
Concatenates this converter with another converter. |
double |
convert(double x)
Converts a double value. |
double |
derivative(double x)
Returns this converter derivative for the specified x value. |
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this converter. |
double |
getOffset()
Returns the offset value for this add converter. |
int |
hashCode()
Returns a hash code value for this converter. |
Converter |
inverse()
Returns the inverse of this converter. |
boolean |
isLinear()
Indicates if this converter is linear. |
Methods inherited from class Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AddConverter(double offset)
offset
- the offset value.Method Detail |
public double getOffset()
public Converter inverse()
Converter
x
is a valid
value, then x == inverse().convert(convert(x))
to within
the accuracy of computer arithmetic.
inverse
in class Converter
public double convert(double x)
Converter
convert
in class Converter
x
- the numeric value to convert.
public double derivative(double x)
Converter
x
value. For linear converters, this method returns
a constant (the linear factor) for all x
values.
derivative
in class Converter
x
- the value for which the derivative is calculated.
public boolean isLinear()
Converter
convert(u + v) == convert(u) + convert(v)
and
convert(r * u) == r * convert(u)
.
isLinear
in class Converter
true
if this converter is linear;
false
otherwise.public Converter concatenate(Converter converter)
Converter
concatenate
in class Converter
converter
- the other converter.
public boolean equals(Object obj)
Converter
equals
in class Converter
obj
- the reference object with which to compare.
true
if this object is a linear converter and this
object is also a linear converter and both have same
derivatives; false
otherwise.public int hashCode()
Converter
hashCode
in class Converter
Converter.equals(java.lang.Object)
|
Java Units API Build 2004-02-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Symbols, terms and definitions | JSR-108 project |