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
protected static final class SimpleUnitFormat.ASCIIFormat extends SimpleUnitFormat.DefaultFormat
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 Modifier Constructor Description protectedASCIIFormat()
-
Method Summary
Modifier and Type Method Description Appendableformat(javax.measure.Unit<?> unit, Appendable appendable)Formats the specified unit.protected booleanisValidIdentifier(String name)Indicates if the specified name can be used as unit identifier.protected StringnameFor(javax.measure.Unit<?> unit)StringtoString()protected javax.measure.Unit<?>unitFor(String name)-
Methods inherited from class tech.units.indriya.format.SimpleUnitFormat.DefaultFormat
alias, 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
-
-
-
-
Constructor Detail
-
ASCIIFormat
protected ASCIIFormat()
-
-
Method Detail
-
nameFor
protected String nameFor(javax.measure.Unit<?> unit)
- Overrides:
nameForin classSimpleUnitFormat.DefaultFormat
-
unitFor
protected javax.measure.Unit<?> unitFor(String name)
- Overrides:
unitForin classSimpleUnitFormat.DefaultFormat
-
toString
public String toString()
- Overrides:
toStringin classSimpleUnitFormat.DefaultFormat
-
format
public Appendable format(javax.measure.Unit<?> unit, Appendable appendable) throws IOException
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
protected boolean isValidIdentifier(String name)
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.
-
-