Package org.jfree.chart.util
Class LogFormat
java.lang.Object
java.text.Format
java.text.NumberFormat
org.jfree.chart.util.LogFormat
- All Implemented Interfaces:
Serializable
,Cloneable
A number formatter for logarithmic values. This formatter does not support
parsing.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.text.NumberFormat
NumberFormat.Field, NumberFormat.Style
-
Field Summary
Fields inherited from class java.text.NumberFormat
FRACTION_FIELD, INTEGER_FIELD
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a clone of this instance.boolean
Tests this formatter for equality with an arbitrary object.format
(double number, StringBuffer toAppendTo, FieldPosition pos) Returns a formatted representation of the specified number.format
(long number, StringBuffer toAppendTo, FieldPosition pos) Formats the specified number as a hexadecimal string.Returns the number format used for the exponent.parse
(String source, ParsePosition parsePosition) Parsing is not implemented, so this method always returnsnull
.void
setExponentFormat
(NumberFormat format) Sets the number format used for the exponent.Methods inherited from class java.text.NumberFormat
format, format, format, getAvailableLocales, getCompactNumberInstance, getCompactNumberInstance, getCurrency, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, getRoundingMode, hashCode, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setCurrency, setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setParseIntegerOnly, setRoundingMode
Methods inherited from class java.text.Format
format, formatToCharacterIterator, parseObject
-
Constructor Details
-
LogFormat
public LogFormat()Creates a new instance using base 10. -
LogFormat
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.
-
LogFormat
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.
-
-
Method Details
-
getExponentFormat
Returns the number format used for the exponent.- Returns:
- The number format (never
null
).
-
setExponentFormat
Sets the number format used for the exponent.- Parameters:
format
- the formatter (null
not permitted).
-
format
Returns a formatted representation of the specified number.- Specified by:
format
in classNumberFormat
- Parameters:
number
- the number.toAppendTo
- the string buffer to append to.pos
- the position.- Returns:
- A string buffer containing the formatted value.
-
format
Formats the specified number as a hexadecimal string. The decimal fraction is ignored.- Specified by:
format
in classNumberFormat
- 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
Parsing is not implemented, so this method always returnsnull
.- Specified by:
parse
in classNumberFormat
- Parameters:
source
- ignored.parsePosition
- ignored.- Returns:
- Always
null
.
-
equals
Tests this formatter for equality with an arbitrary object.- Overrides:
equals
in classNumberFormat
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-
clone
Returns a clone of this instance.- Overrides:
clone
in classNumberFormat
- Returns:
- A clone.
-