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 enum
Suffix that describes a particular quantity of units (micron, nano, square microns etc.) -
Method Summary
Modifier and TypeMethodDescriptionstatic double
convertFromUnits
(double valueUnits, String unitSuffix) Converts a value from another unit-type to base units.static double
convertFromUnits
(double valueUnits, SpatialUnits.UnitSuffix unitSuffix) Converts a value from another unit-type to base units.static double
convertToUnits
(double valueBaseUnits, String unitSuffix) Converts a value in base-units to another unit-type.static double
convertToUnits
(double valueBaseUnits, SpatialUnits.UnitSuffix unitSuffix) Converts a value in base-units to another unit-type.static String
A string that describes the suffix for meters.
-
Method Details
-
suffixStringForMeters
A string that describes the suffix for meters.e.g.
m^2
ornm^3
etc.- 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.
-