Package org.openjdk.jmc.common.unit
Class DisplayFormatter<T>
java.lang.Object
org.openjdk.jmc.common.unit.DisplayFormatter<T>
- Type Parameters:
T
- the type of values that can be formatted
- All Implemented Interfaces:
IFormatter<T>
- Direct Known Subclasses:
KindOfQuantity.ExactFormatter
,KindOfQuantity.VerboseFormatter
,LinearKindOfQuantity.AutoFormatter
,LinearKindOfQuantity.DualUnitFormatter
A display formatter is basically an identifier that tells a user interface widget how the unit
should be formatted, e.g. as a kilobytes. Currently the display unit doesn't contain any
information about what makes the unit, for instance 1 kilobyte is 1024 times as much as a byte or
the precision. This could be added on later by sub-classing
DisplayFormatter
and by
adding properties specific for the DisplayFormatter
.
A display formatter with the magic identifier "auto" should be used to tells the user interface widget that it can decide by itself how the unit should be formatted. E.g, if it is a large number it may decide show it as GiB, but if it is a low number it may choose bytes.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DisplayFormatter
(ContentType<T> contentType, String identifier, String name) -
Method Summary
-
Field Details
-
ENGINEERING_NOTATION_IDENTIFIER
- See Also:
-
SCIENTIFIC_NOTATION_IDENTIFIER
- See Also:
-
-
Constructor Details
-
DisplayFormatter
-
-
Method Details
-
getName
-
getIdentifier
-
getContentType
-
format
- Specified by:
format
in interfaceIFormatter<T>
-