T
- the type of values that can be formattedpublic class DisplayFormatter<T> extends java.lang.Object implements IFormatter<T>
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.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ENGINEERING_NOTATION_IDENTIFIER |
private ContentType<T> |
m_contentType |
private java.lang.String |
m_identifier |
private java.lang.String |
m_name |
static java.lang.String |
SCIENTIFIC_NOTATION_IDENTIFIER |
Modifier | Constructor and Description |
---|---|
protected |
DisplayFormatter(ContentType<T> contentType,
java.lang.String identifier,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
format(T o) |
ContentType<T> |
getContentType() |
java.lang.String |
getIdentifier() |
java.lang.String |
getName() |
public static final java.lang.String ENGINEERING_NOTATION_IDENTIFIER
public static final java.lang.String SCIENTIFIC_NOTATION_IDENTIFIER
private final java.lang.String m_name
private final java.lang.String m_identifier
private final ContentType<T> m_contentType
protected DisplayFormatter(ContentType<T> contentType, java.lang.String identifier, java.lang.String name)
public java.lang.String getName()
public java.lang.String getIdentifier()
public ContentType<T> getContentType()
public java.lang.String format(T o)
format
in interface IFormatter<T>