public class Format extends Object implements TicLabelFormat
Constructor and Description |
---|
Format(String formatString)
Creates an instance for the specified format string.
|
Modifier and Type | Method and Description |
---|---|
static Format |
create(ConfigParameters config,
String key)
Creates a new instance based of specified key-value pair of the
specified configuration parameters.
|
String |
form(double number)
Format a number.
|
String |
form(double[] numbers)
Format an array of double numbers.
|
String |
form(long number)
Format a number.
|
public Format(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.IllegalArgumentException
- if invalid format string.public static Format create(ConfigParameters config, 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 String form(long number)
number
- Number to be formated.public String form(double number)
form
in interface TicLabelFormat
number
- Number to be formated.public String form(double[] numbers)
numbers
- Numbers to be formated.Copyright © 2015. All Rights Reserved.