Package tech.units.indriya.format
Class SimpleUnitFormat.ASCIIFormat
java.lang.Object
tech.units.indriya.format.AbstractUnitFormat
tech.units.indriya.format.SimpleUnitFormat
tech.units.indriya.format.SimpleUnitFormat.DefaultFormat
tech.units.indriya.format.SimpleUnitFormat.ASCIIFormat
- All Implemented Interfaces:
javax.measure.format.UnitFormat
- Enclosing class:
- SimpleUnitFormat
This class represents the ASCII format.
-
Nested Class Summary
Nested classes/interfaces inherited from class tech.units.indriya.format.SimpleUnitFormat
SimpleUnitFormat.ASCIIFormat, SimpleUnitFormat.DefaultFormat, SimpleUnitFormat.Flavor
-
Field Summary
Fields inherited from class tech.units.indriya.format.SimpleUnitFormat.DefaultFormat
nameToUnit, unitToName
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformat
(javax.measure.Unit<?> unit, Appendable appendable) Formats the specified unit.boolean
isValidIdentifier
(String name) Indicates if the specified name can be used as unit identifier.protected String
nameFor
(javax.measure.Unit<?> unit) protected javax.measure.Unit<?>
Methods inherited from class tech.units.indriya.format.SimpleUnitFormat.DefaultFormat
alias, getSymbols, isLocaleSensitive, isUnitIdentifierPart, label, parse, parse, parse, parseProductUnit, parseSingleUnit, prefixFor
Methods inherited from class tech.units.indriya.format.SimpleUnitFormat
format, getInstance, getInstance, isAllASCII, parseObject
Methods inherited from class tech.units.indriya.format.AbstractUnitFormat
format, format
-
Constructor Details
-
ASCIIFormat
protected ASCIIFormat()
-
-
Method Details
-
nameFor
- Overrides:
nameFor
in classSimpleUnitFormat.DefaultFormat
-
unitFor
- Overrides:
unitFor
in classSimpleUnitFormat.DefaultFormat
-
format
Description copied from class:SimpleUnitFormat
Formats the specified unit.- Specified by:
format
in interfacejavax.measure.format.UnitFormat
- Overrides:
format
in classSimpleUnitFormat.DefaultFormat
- Parameters:
unit
- the unit to format.appendable
- the appendable destination.- Returns:
- The appendable destination passed in as
appendable
, with formatted text appended. - Throws:
IOException
- if an error occurs.
-
isValidIdentifier
Description copied from class:SimpleUnitFormat
Indicates if the specified name can be used as unit identifier.- Overrides:
isValidIdentifier
in classSimpleUnitFormat.DefaultFormat
- Parameters:
name
- the identifier to be tested.- Returns:
true
if the name specified can be used as label or alias for this format;false
otherwise.
-