- java.lang.Object
-
- java.text.Format
-
- java.text.NumberFormat
-
- org.jfree.chart.text.format.LogFormat
-
- All Implemented Interfaces:
Serializable,Cloneable
public class LogFormat extends NumberFormat
A number formatter for logarithmic values. This formatter does not support parsing.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.text.NumberFormat
NumberFormat.Field
-
-
Field Summary
-
Fields inherited from class java.text.NumberFormat
FRACTION_FIELD, INTEGER_FIELD
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()Returns a clone of this instance.booleanequals(Object obj)Tests this formatter for equality with an arbitrary object.StringBufferformat(double number, StringBuffer toAppendTo, FieldPosition pos)Returns a formatted representation of the specified number.StringBufferformat(long number, StringBuffer toAppendTo, FieldPosition pos)Formats the specified number as a hexadecimal string.NumberFormatgetExponentFormat()Returns the number format used for the exponent.Numberparse(String source, ParsePosition parsePosition)Parsing is not implemented, so this method always returnsnull.voidsetExponentFormat(NumberFormat format)Sets the number format used for the exponent.-
Methods inherited from class java.text.NumberFormat
format, format, format, getAvailableLocales, 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 Detail
-
LogFormat
public LogFormat()
Creates a new instance using base 10.
-
LogFormat
public LogFormat(double base, String baseLabel, boolean showBase)
Creates a new instance.- Parameters:
base- the base.baseLabel- the base label (nullnot permitted).showBase- a flag that controls whether or not the base value is shown.
-
LogFormat
public LogFormat(double base, String baseLabel, String powerLabel, boolean showBase)
Creates a new instance.- Parameters:
base- the base.baseLabel- the base label (nullnot permitted).powerLabel- the power label (nullnot permitted).showBase- a flag that controls whether or not the base value is shown.
-
-
Method Detail
-
getExponentFormat
public NumberFormat getExponentFormat()
Returns the number format used for the exponent.- Returns:
- The number format (never
null).
-
setExponentFormat
public void setExponentFormat(NumberFormat format)
Sets the number format used for the exponent.- Parameters:
format- the formatter (nullnot permitted).
-
format
public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition pos)
Returns a formatted representation of the specified number.- Specified by:
formatin classNumberFormat- 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.- Specified by:
formatin 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
public Number parse(String source, ParsePosition parsePosition)
Parsing is not implemented, so this method always returnsnull.- Specified by:
parsein classNumberFormat- Parameters:
source- ignored.parsePosition- ignored.- Returns:
- Always
null.
-
equals
public boolean equals(Object obj)
Tests this formatter for equality with an arbitrary object.- Overrides:
equalsin classNumberFormat- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
clone
public Object clone()
Returns a clone of this instance.- Overrides:
clonein classNumberFormat- Returns:
- A clone.
-
-