|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjcckit.util.Format
public class Format
A helper class for formatting numbers according to a printf-like format string. Each instance of this class is initialized by a format string for a single number.
| Constructor Summary | |
|---|---|
Format(String formatString)
Creates an instance for the specified format string. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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.| Method Detail |
|---|
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 TicLabelFormatnumber - Number to be formated.
public String form(double[] numbers)
numbers - Numbers to be formated.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||