Package com.squarespace.cldrengine.units
Class UnitsImpl
- java.lang.Object
-
- com.squarespace.cldrengine.units.UnitsImpl
-
-
Constructor Summary
Constructors Constructor Description UnitsImpl(Bundle bundle, Internals internal, PrivateApi privateApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<UnitType>
availableUnits()
Returns an array of available units.java.lang.String
formatQuantity(Quantity qty)
Formats the given unit quantity to string.java.lang.String
formatQuantity(Quantity qty, UnitFormatOptions options)
Formats the given unit quantity to string.java.lang.String
formatQuantitySequence(java.util.List<Quantity> qty)
Formats the given unit quantity sequence to string.java.lang.String
formatQuantitySequence(java.util.List<Quantity> qty, UnitFormatOptions options)
Formats the given unit quantity sequence to string.java.util.List<Part>
formatQuantitySequenceToParts(java.util.List<Quantity> qty)
Formats the given unit quantity sequence to an array of parts.java.util.List<Part>
formatQuantitySequenceToParts(java.util.List<Quantity> qty, UnitFormatOptions options)
Formats the given unit quantity sequence to an array of parts.java.util.List<Part>
formatQuantityToParts(Quantity qty)
Formats the given unit quantity to an array of parts.java.util.List<Part>
formatQuantityToParts(Quantity qty, UnitFormatOptions options)
Formats the given unit quantity to an array of parts.java.lang.String
getUnitDisplayName(UnitType unit, UnitLength length)
Returns the display name for the given unit.protected ListPatternType
selectListType(UnitFormatOptions options)
-
-
-
Constructor Detail
-
UnitsImpl
public UnitsImpl(Bundle bundle, Internals internal, PrivateApi privateApi)
-
-
Method Detail
-
availableUnits
public java.util.List<UnitType> availableUnits()
Description copied from interface:Units
Returns an array of available units.- Specified by:
availableUnits
in interfaceUnits
-
getUnitDisplayName
public java.lang.String getUnitDisplayName(UnitType unit, UnitLength length)
Description copied from interface:Units
Returns the display name for the given unit.- Specified by:
getUnitDisplayName
in interfaceUnits
-
formatQuantity
public java.lang.String formatQuantity(Quantity qty)
Description copied from interface:Units
Formats the given unit quantity to string.- Specified by:
formatQuantity
in interfaceUnits
-
formatQuantity
public java.lang.String formatQuantity(Quantity qty, UnitFormatOptions options)
Description copied from interface:Units
Formats the given unit quantity to string.- Specified by:
formatQuantity
in interfaceUnits
-
formatQuantityToParts
public java.util.List<Part> formatQuantityToParts(Quantity qty)
Description copied from interface:Units
Formats the given unit quantity to an array of parts.- Specified by:
formatQuantityToParts
in interfaceUnits
-
formatQuantityToParts
public java.util.List<Part> formatQuantityToParts(Quantity qty, UnitFormatOptions options)
Description copied from interface:Units
Formats the given unit quantity to an array of parts.- Specified by:
formatQuantityToParts
in interfaceUnits
-
formatQuantitySequence
public java.lang.String formatQuantitySequence(java.util.List<Quantity> qty)
Description copied from interface:Units
Formats the given unit quantity sequence to string.- Specified by:
formatQuantitySequence
in interfaceUnits
-
formatQuantitySequence
public java.lang.String formatQuantitySequence(java.util.List<Quantity> qty, UnitFormatOptions options)
Description copied from interface:Units
Formats the given unit quantity sequence to string.- Specified by:
formatQuantitySequence
in interfaceUnits
-
formatQuantitySequenceToParts
public java.util.List<Part> formatQuantitySequenceToParts(java.util.List<Quantity> qty)
Description copied from interface:Units
Formats the given unit quantity sequence to an array of parts.- Specified by:
formatQuantitySequenceToParts
in interfaceUnits
-
formatQuantitySequenceToParts
public java.util.List<Part> formatQuantitySequenceToParts(java.util.List<Quantity> qty, UnitFormatOptions options)
Description copied from interface:Units
Formats the given unit quantity sequence to an array of parts.- Specified by:
formatQuantitySequenceToParts
in interfaceUnits
-
selectListType
protected ListPatternType selectListType(UnitFormatOptions options)
-
-