Package org.geotools.measure
Class WktUnitFormat
- Object
- 
- BaseUnitFormatter
- 
- WktUnitFormat
 
 
- 
- All Implemented Interfaces:
- UnitFormatter
 
 public final class WktUnitFormat extends BaseUnitFormatter UnitFormat configured to parse units. Since usually we don't know the citation in use for a particular unit literal definition, this format includes the aliases of EPSG and ESRI citations, in order to be able to parse the widest possible range of units.
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLabel(Unit<?> unit, String label)Attaches a system-wide label to the specified unit.<Q extends Quantity<Q>>
 Unit<Q>getEquivalentUnit(Unit<Q> unit)Returns an equivalent unit instance based on the provided unit.static UnitFormattergetInstance()- 
Methods inherited from class BaseUnitFormatteraddAlias, format, isUnitIdentifierPart, isValidIdentifier, nameFor, parse, parse, parseObject, parseProductUnit, parseSingleUnit, prefixFor, toString
 - 
Methods inherited from class Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface UnitFormatterformat
 
- 
 
- 
- 
- 
Method Detail- 
getInstancepublic static UnitFormatter getInstance() 
 - 
addLabelpublic void addLabel(Unit<?> unit, String label)Description copied from class:BaseUnitFormatterAttaches a system-wide label to the specified unit. For example:SimpleUnitFormat.getInstance().label(DAY.multiply(365), "year"); SimpleUnitFormat.getInstance().label(METER.multiply(0.3048), "ft");If the specified label is already associated to a unit the previous association is discarded or ignored. The old label is overwritten for labeling/ purposes, but it remains like an alias (it still works for parsing)- Overrides:
- addLabelin class- BaseUnitFormatter
- Parameters:
- unit- the unit being labeled.
- label- the new label for this unit.
 
 - 
getEquivalentUnitpublic <Q extends Quantity<Q>> Unit<Q> getEquivalentUnit(Unit<Q> unit) Returns an equivalent unit instance based on the provided unit. First, it tries to get one of the reference units defined in the JSR 385 implementation in use. If no equivalent reference unit is defined, it returns the provided unit
 
- 
 
-