public final class Units extends Object
SI and NonSI.| Modifier and Type | Field and Description |
|---|---|
static Unit<Time> |
DAY
Helper definition so someone can align to GeoTools Day Unit type *
|
static Unit<Angle> |
DEGREE_ANGLE |
static Unit<Angle> |
DEGREE_MINUTE_SECOND
Pseudo-unit for degree - minute - second.
|
static Unit<Length> |
FOOT |
static Unit<Angle> |
GRADE |
static Unit<Length> |
KILOMETER |
static Unit<Length> |
METRE |
static Unit<Angle> |
MICRORADIAN |
static Unit<Angle> |
MINUTE_ANGLE |
static Unit<Time> |
MONTH
Time duration of
1/12 of a Units.YEAR. |
static Unit<Length> |
NAUTICAL_MILE |
static Unit<Dimensionless> |
ONE |
static Unit<Length> |
PIXEL
Length of
1/72 of a USCustomary.INCH |
static Unit<Dimensionless> |
PPM
Parts per million.
|
static Unit<Angle> |
RADIAN |
static Unit<Angle> |
SECOND_ANGLE |
static Unit<Angle> |
SEXAGESIMAL_DMS
Pseudo-unit for sexagesimal degree.
|
static Unit<Time> |
YEAR |
| Modifier and Type | Method and Description |
|---|---|
static <Q extends Quantity<Q>> |
autoCorrect(Unit<Q> unit)
Returns an equivalent unit instance based on the provided unit.
|
static boolean |
equals(Unit<?> unit1,
Unit<?> unit2)
Checks whether two units can be considered equivalent.
|
static UnitConverter |
getConverterToAny(Unit<?> fromUnit,
Unit<?> toUnit)
Gets a UnitConverter between two units, wrapping any raised exception in a
IllegalArgumentException.
|
static UnitFormat |
getDefaultFormat()
Gets an instance of the default system-wide Unit format.
|
static Unit<?> |
parseUnit(String name)
Parses the text into an instance of unit
|
static String |
toName(Unit<?> unit)
Unit name, willing to use
SimpleUnitFormat to look up appropriate label if a name has
not been not defined. |
static String |
toSymbol(Unit<?> unit)
Unit symbol, willing to use
SimpleUnitFormat to look up appropriate label if
required. |
public static final Unit<Angle> DEGREE_ANGLE
public static final Unit<Angle> DEGREE_MINUTE_SECOND
signed degrees (integer) - arc-minutes (integer) - arc-seconds (real, any precision).
This unit is non-linear and not practical for computation. Consequently, it should be avoid as much as possible. Unfortunately, this pseudo-unit is extensively used in the EPSG database (code 9107).
public static final Unit<Angle> GRADE
public static final Unit<Angle> MICRORADIAN
public static final Unit<Angle> MINUTE_ANGLE
public static final Unit<Angle> RADIAN
public static final Unit<Angle> SEXAGESIMAL_DMS
sign - degrees - decimal point - minutes (two digits) - integer seconds (two digits) - fraction of seconds (any precision).
This unit is non-linear and not pratical for computation. Consequently, it should be avoid as much as possible. Unfortunatly, this pseudo-unit is extensively used in the EPSG database (code 9110).
public static final Unit<Angle> SECOND_ANGLE
public static final Unit<Dimensionless> PPM
public static final Unit<Dimensionless> ONE
public static final Unit<Length> FOOT
public static final Unit<Length> METRE
public static final Unit<Length> KILOMETER
public static final Unit<Length> NAUTICAL_MILE
public static final Unit<Length> PIXEL
1/72 of a USCustomary.INCHpublic static final Unit<Time> DAY
public static final Unit<Time> MONTH
1/12 of a Units.YEAR.public static final Unit<Time> YEAR
public static UnitFormat getDefaultFormat()
GeoToolsUnitFormat.getInstance()public static String toName(Unit<?> unit)
SimpleUnitFormat to look up appropriate label if a name has
not been not defined.
This allows us to format units like PIXEL.
public static String toSymbol(Unit<?> unit)
SimpleUnitFormat to look up appropriate label if
required.
This allows us to format units like PIXEL.
public static <Q extends Quantity<Q>> Unit<Q> autoCorrect(Unit<Q> unit)
equals(Unit, Unit) method returns true. If no equivalent
reference unit is defined, it returns the provided unit.public static final boolean equals(Unit<?> unit1,
Unit<?> unit2)
public static UnitConverter getConverterToAny(Unit<?> fromUnit,
Unit<?> toUnit)
IllegalArgumentException - if unit1 can't be converter to unit2public static Unit<?> parseUnit(String name)
MeasurementParseException - if any problem occurs while parsing
the specified character sequence (e.g. illegal syntax).UnsupportedOperationException - if the UnitFormat is unable to parse.UnitFormat.parse(CharSequence)Copyright © 1996–2021 Geotools. All rights reserved.