public class

LogFormat

extends NumberFormat
java.lang.Object
   ↳ java.text.Format
     ↳ java.text.NumberFormat
       ↳ org.jfree.chart.util.LogFormat

Class Overview

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

Summary

[Expand]
Inherited Constants
From class java.text.NumberFormat
Public Constructors
LogFormat()
Creates a new instance using base 10.
LogFormat(double base, String baseLabel, boolean showBase)
Creates a new instance.
LogFormat(double base, String baseLabel, String powerLabel, boolean showBase)
Creates a new instance.
Public Methods
Object clone()
Returns a clone of this instance.
boolean equals(Object obj)
Tests this formatter for equality with an arbitrary object.
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.
NumberFormat getExponentFormat()
Returns the number format used for the exponent.
Number parse(String source, ParsePosition parsePosition)
Parsing is not implemented, so this method always returns null.
void setExponentFormat(NumberFormat format)
Sets the number format used for the exponent.
[Expand]
Inherited Methods
From class java.text.NumberFormat
From class java.text.Format
From class java.lang.Object

Public Constructors

public LogFormat ()

Creates a new instance using base 10.

public LogFormat (double base, String baseLabel, boolean showBase)

Creates a new instance.

Parameters
base the base.
baseLabel the base label (null not permitted).
showBase a flag that controls whether or not the base value is shown.

public LogFormat (double base, String baseLabel, String powerLabel, boolean showBase)

Creates a new instance.

Parameters
base the base.
baseLabel the base label (null not permitted).
powerLabel the power label (null not permitted).
showBase a flag that controls whether or not the base value is shown.

Public Methods

public Object clone ()

Returns a clone of this instance.

Returns
  • A clone.

public boolean equals (Object obj)

Tests this formatter for equality with an arbitrary object.

Parameters
obj the object (null permitted).
Returns
  • A boolean.

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.

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.

public NumberFormat getExponentFormat ()

Returns the number format used for the exponent.

Returns
  • The number format (never null).

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.

public void setExponentFormat (NumberFormat format)

Sets the number format used for the exponent.

Parameters
format the formatter (null not permitted).