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.booleanisValidIdentifier(String name) Indicates if the specified name can be used as unit identifier.protected StringnameFor(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, prefixForMethods inherited from class tech.units.indriya.format.SimpleUnitFormat
format, getInstance, getInstance, isAllASCII, parseObjectMethods inherited from class tech.units.indriya.format.AbstractUnitFormat
format, format
-
Constructor Details
-
ASCIIFormat
protected ASCIIFormat()
-
-
Method Details
-
nameFor
- Overrides:
nameForin classSimpleUnitFormat.DefaultFormat
-
unitFor
- Overrides:
unitForin classSimpleUnitFormat.DefaultFormat
-
format
Description copied from class:SimpleUnitFormatFormats the specified unit.- Specified by:
formatin interfacejavax.measure.format.UnitFormat- Overrides:
formatin 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:SimpleUnitFormatIndicates if the specified name can be used as unit identifier.- Overrides:
isValidIdentifierin classSimpleUnitFormat.DefaultFormat- Parameters:
name- the identifier to be tested.- Returns:
trueif the name specified can be used as label or alias for this format;falseotherwise.
-