public class Format extends java.lang.Object implements TicLabelFormat
| Constructor and Description |
|---|
Format(java.lang.String formatString)
Creates an instance for the specified format string.
|
| Modifier and Type | Method and Description |
|---|---|
static Format |
create(ConfigParameters config,
java.lang.String key)
Creates a new instance based of specified key-value pair of the
specified configuration parameters.
|
java.lang.String |
form(double number)
Format a number.
|
java.lang.String |
form(double[] numbers)
Format an array of double numbers.
|
java.lang.String |
form(long number)
Format a number.
|
public Format(java.lang.String formatString)
| d | decimal integer |
| o | octal integer |
| x | hex integer |
| f | floating point number with a fixed decimal point |
| e, E | floating point number in logarithmic format |
| g, G | floating point number rendered either in fixed-decimal format of logarithmic format depending on the size of the mantissa. |
formatString - The format string.java.lang.IllegalArgumentException - if invalid format string.public static Format create(ConfigParameters config, java.lang.String key)
config - Config parameters.key - The key of the key-value pair in config containing
the format string.FactoryException - if the format string is invalid.public java.lang.String form(long number)
number - Number to be formated.public java.lang.String form(double number)
form in interface TicLabelFormatnumber - Number to be formated.public java.lang.String form(double[] numbers)
numbers - Numbers to be formated.