Package org.djunits.unit.scale
Class IdentityScale
java.lang.Object
org.djunits.unit.scale.LinearScale
org.djunits.unit.scale.IdentityScale
- All Implemented Interfaces:
Serializable,Scale
A Scale for standard, e.g. SI, units. Values in these units need no conversion.
Copyright (c) 2013-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IdentityScaleA ready-to-use instance of the standard scale (they are all the same...). -
Method Summary
Modifier and TypeMethodDescriptiondoublefromBaseValue(double value) Convert a value from a base (SI) value to a value in the unit that uses this scale.doubletoBaseValue(double value) Convert a value expressed in this unit to its base (SI) value.toString()Methods inherited from class org.djunits.unit.scale.LinearScale
equals, getScaleFactorToBaseUnit, hashCode, isBaseScale
-
Field Details
-
SCALE
A ready-to-use instance of the standard scale (they are all the same...).
-
-
Method Details
-
toBaseValue
public double toBaseValue(double value) Description copied from interface:ScaleConvert a value expressed in this unit to its base (SI) value.- Specified by:
toBaseValuein interfaceScale- Overrides:
toBaseValuein classLinearScale- Parameters:
value- the value expressed in this unit- Returns:
- the value converted to its SI value
-
fromBaseValue
public double fromBaseValue(double value) Description copied from interface:ScaleConvert a value from a base (SI) value to a value in the unit that uses this scale.- Specified by:
fromBaseValuein interfaceScale- Overrides:
fromBaseValuein classLinearScale- Parameters:
value- the value to convert- Returns:
- the corresponding value in the given unit
-
toString
- Overrides:
toStringin classLinearScale
-