Class SpatialUnits
Object
SpatialUnits
Units to describe spatial quantities.
These units can be specified by a string or an enum.
e.g. find a enum for nm.
e.g. find a string representation for NANO.
Acceptable string representations are: m, mm, mm^2, mm^3, nm, nm^2, nm^3, μm, μm^2,
μm^3.
- Author:
- Owen Feehan
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSuffix that describes a particular quantity of units (micron, nano, square microns etc.) -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleconvertFromUnits(double valueUnits, String unitSuffix) Converts a value from another unit-type to base units.static doubleconvertFromUnits(double valueUnits, SpatialUnits.UnitSuffix unitSuffix) Converts a value from another unit-type to base units.static doubleconvertToUnits(double valueBaseUnits, String unitSuffix) Converts a value in base-units to another unit-type.static doubleconvertToUnits(double valueBaseUnits, SpatialUnits.UnitSuffix unitSuffix) Converts a value in base-units to another unit-type.static StringA string that describes the suffix for meters.
-
Method Details
-
suffixStringForMeters
A string that describes the suffix for meters.e.g.
m^2ornm^3etc.- Parameters:
suffix- the suffix to describe.- Returns:
- a string describing the suffix as applied to meters.
-
convertToUnits
Converts a value in base-units to another unit-type.- Parameters:
valueBaseUnits- the value in base units.unitSuffix- the suffix describing the desired unit.- Returns:
- the value in units of type @{code unitSuffix}.
-
convertToUnits
Converts a value in base-units to another unit-type.- Parameters:
valueBaseUnits- the value in base units.unitSuffix- the suffix describing the desired unit.- Returns:
- the value in units of type @{code unitSuffix}.
-
convertFromUnits
Converts a value from another unit-type to base units.- Parameters:
valueUnits- the value in base units.unitSuffix- the suffix associated withvalueUnits.- Returns:
- the value in base units.
-
convertFromUnits
Converts a value from another unit-type to base units.- Parameters:
valueUnits- the value in base units.unitSuffix- the suffix associated withvalueUnits.- Returns:
- the value in base units.
-