org.jfree.chart.util

Class LogFormat


public class LogFormat
extends NumberFormat

A number formatter for logarithmic values. This formatter does not support parsing.
Since:
1.0.7

Constructor Summary

LogFormat(double base, String baseLabel, boolean showBase)
Creates a new instance.

Method Summary

StringBuffer
format(double number, StringBuffer toAppendTo, FieldPosition pos)
Returns a formatted representation of the specified number.
StringBuffer
format(long number, StringBuffer toAppendTo, FieldPosition pos)
Formats the specified number as a hexadecimal string.
Number
parse(String source, ParsePosition parsePosition)
Parsing is not implemented, so this method always returns null.

Constructor Details

LogFormat

public LogFormat(double base,
                 String baseLabel,
                 boolean showBase)
Creates a new instance.
Parameters:
base - the base.
baseLabel - the base label.
showBase - a flag that controls whether or not the base value is shown.

Method Details

format

public StringBuffer format(double number,
                           StringBuffer toAppendTo,
                           FieldPosition pos)
Returns a formatted representation of the specified number.
Parameters:
number - the number.
toAppendTo - the string buffer to append to.
pos - the position.
Returns:
A string buffer containing the formatted value.

format

public StringBuffer format(long number,
                           StringBuffer toAppendTo,
                           FieldPosition pos)
Formats the specified number as a hexadecimal string. The decimal fraction is ignored.
Parameters:
number - the number to format.
toAppendTo - the buffer to append to (ignored here).
pos - the field position (ignored here).
Returns:
The string buffer.

parse

public Number parse(String source,
                    ParsePosition parsePosition)
Parsing is not implemented, so this method always returns null.
Parameters:
source - ignored.
parsePosition - ignored.
Returns:
Always null.