Package org.jfree.chart.labels
Class AbstractXYItemLabelGenerator
java.lang.Object
org.jfree.chart.labels.AbstractXYItemLabelGenerator
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
BubbleXYItemLabelGenerator,IntervalXYItemLabelGenerator,IntervalXYToolTipGenerator,StandardXYItemLabelGenerator,StandardXYToolTipGenerator
A base class for creating item label generators.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates an item label generator using default number formatters.protectedAbstractXYItemLabelGenerator(String formatString, DateFormat xFormat, DateFormat yFormat) Creates an item label generator using the specified number formatters.protectedAbstractXYItemLabelGenerator(String formatString, DateFormat xFormat, NumberFormat yFormat) Creates an item label generator using the specified number formatters.protectedAbstractXYItemLabelGenerator(String formatString, NumberFormat xFormat, DateFormat yFormat) Creates an item label generator using the specified formatters (a number formatter for the x-values and a date formatter for the y-values).protectedAbstractXYItemLabelGenerator(String formatString, NumberFormat xFormat, NumberFormat yFormat) Creates an item label generator using the specified number formatters. -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns an independent copy of the generator.protected Object[]createItemArray(XYDataset dataset, int series, int item) Creates the array of items that can be passed to theMessageFormatclass for creating labels.booleanTests this object for equality with an arbitrary object.generateLabelString(XYDataset dataset, int series, int item) Generates a label string for an item in the dataset.Returns the format string (this controls the overall structure of the label).Returns the string representing a null value.Returns the date formatter for the x-values.Returns the number formatter for the x-values.Returns the date formatter for the y-values.Returns the number formatter for the y-values.inthashCode()Returns a hash code for this instance.
-
Constructor Details
-
AbstractXYItemLabelGenerator
protected AbstractXYItemLabelGenerator()Creates an item label generator using default number formatters. -
AbstractXYItemLabelGenerator
protected AbstractXYItemLabelGenerator(String formatString, NumberFormat xFormat, NumberFormat yFormat) Creates an item label generator using the specified number formatters.- Parameters:
formatString- the item label format string (nullnot permitted).xFormat- the format object for the x values (nullnot permitted).yFormat- the format object for the y values (nullnot permitted).
-
AbstractXYItemLabelGenerator
protected AbstractXYItemLabelGenerator(String formatString, DateFormat xFormat, NumberFormat yFormat) Creates an item label generator using the specified number formatters.- Parameters:
formatString- the item label format string (nullnot permitted).xFormat- the format object for the x values (nullpermitted).yFormat- the format object for the y values (nullnot permitted).
-
AbstractXYItemLabelGenerator
protected AbstractXYItemLabelGenerator(String formatString, NumberFormat xFormat, DateFormat yFormat) Creates an item label generator using the specified formatters (a number formatter for the x-values and a date formatter for the y-values).- Parameters:
formatString- the item label format string (nullnot permitted).xFormat- the format object for the x values (nullpermitted).yFormat- the format object for the y values (nullnot permitted).
-
AbstractXYItemLabelGenerator
Creates an item label generator using the specified number formatters.- Parameters:
formatString- the item label format string (nullnot permitted).xFormat- the format object for the x values (nullpermitted).yFormat- the format object for the y values (nullnot permitted).
-
-
Method Details
-
getFormatString
Returns the format string (this controls the overall structure of the label).- Returns:
- The format string (never
null).
-
getXFormat
Returns the number formatter for the x-values.- Returns:
- The number formatter (possibly
null).
-
getXDateFormat
Returns the date formatter for the x-values.- Returns:
- The date formatter (possibly
null).
-
getYFormat
Returns the number formatter for the y-values.- Returns:
- The number formatter (possibly
null).
-
getYDateFormat
Returns the date formatter for the y-values.- Returns:
- The date formatter (possibly
null).
-
generateLabelString
Generates a label string for an item in the dataset.- Parameters:
dataset- the dataset (nullnot permitted).series- the series (zero-based index).item- the item (zero-based index).- Returns:
- The label (possibly
null).
-
getNullYString
Returns the string representing a null value.- Returns:
- The string representing a null value.
-
createItemArray
Creates the array of items that can be passed to theMessageFormatclass for creating labels.- Parameters:
dataset- the dataset (nullnot permitted).series- the series (zero-based index).item- the item (zero-based index).- Returns:
- An array of three items from the dataset formatted as
Stringobjects (nevernull).
-
equals
Tests this object for equality with an arbitrary object. -
hashCode
Returns a hash code for this instance. -
clone
Returns an independent copy of the generator.- Overrides:
clonein classObject- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if cloning is not supported.
-