public class OffsetLinearScale extends LinearScale implements Scale
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
| Constructor and Description |
|---|
OffsetLinearScale(double conversionFactorToStandardUnit,
double offsetToStandardUnit)
Construct a Scale for linear transformations with an offset, e.g.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
double |
fromStandardUnit(double value)
Convert a value from an SI value to a value in the unit that uses this scale.
|
double |
getOffsetToStandardUnit() |
int |
hashCode() |
boolean |
isBaseSIScale()
Return whether this is a base (SI) scale.
|
double |
toStandardUnit(double value)
Convert a value to an SI value using this scale.
|
getConversionFactorToStandardUnitpublic OffsetLinearScale(double conversionFactorToStandardUnit,
double offsetToStandardUnit)
conversionFactorToStandardUnit - the conversion factor by which this number has to be multiplied to convert it to
the standard (e.g., SI) unit.offsetToStandardUnit - the offset that has to be taken into account for conversions; when converting to a standard
unit, the offset is applied first.public final double toStandardUnit(double value)
toStandardUnit in interface ScaletoStandardUnit in class LinearScalevalue - the value to convertpublic final double fromStandardUnit(double value)
fromStandardUnit in interface ScalefromStandardUnit in class LinearScalevalue - the value to convertpublic final double getOffsetToStandardUnit()
public final boolean isBaseSIScale()
isBaseSIScale in interface ScaleisBaseSIScale in class LinearScalepublic int hashCode()
hashCode in class LinearScalepublic boolean equals(Object obj)
equals in class LinearScaleCopyright © 2015–2018 Delft University of Technology. All rights reserved.