java.lang.Object
org.jfree.chart.labels.StandardXYSeriesLabelGenerator
- All Implemented Interfaces:
Serializable
,Cloneable
,XYSeriesLabelGenerator
,PublicCloneable
public class StandardXYSeriesLabelGenerator
extends Object
implements XYSeriesLabelGenerator, Cloneable, PublicCloneable, Serializable
A standard series label generator for plots that use data from
an
This class implements
XYDataset
.
This class implements
PublicCloneable
by mistake but we retain
this for the sake of backward compatibility.- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates a default series label generator (usesDEFAULT_LABEL_FORMAT
).StandardXYSeriesLabelGenerator
(String format) Creates a new series label generator. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns an independent copy of the generator.protected Object[]
createItemArray
(XYDataset dataset, int series) Creates the array of items that can be passed to theMessageFormat
class for creating labels.boolean
Tests this object for equality with an arbitrary object.generateLabel
(XYDataset dataset, int series) Generates a label for the specified series.int
hashCode()
Returns a hash code for this instance.
-
Field Details
-
DEFAULT_LABEL_FORMAT
The default item label format.- See Also:
-
-
Constructor Details
-
StandardXYSeriesLabelGenerator
public StandardXYSeriesLabelGenerator()Creates a default series label generator (usesDEFAULT_LABEL_FORMAT
). -
StandardXYSeriesLabelGenerator
Creates a new series label generator.- Parameters:
format
- the format pattern (null
not permitted).
-
-
Method Details
-
generateLabel
Generates a label for the specified series. This label will be used for the chart legend.- Specified by:
generateLabel
in interfaceXYSeriesLabelGenerator
- Parameters:
dataset
- the dataset (null
not permitted).series
- the series.- Returns:
- A series label.
-
createItemArray
Creates the array of items that can be passed to theMessageFormat
class for creating labels.- Parameters:
dataset
- the dataset (null
not permitted).series
- the series (zero-based index).- Returns:
- The items (never
null
).
-
clone
Returns an independent copy of the generator. This is unnecessary, because instances are immutable anyway, but we retain this behaviour for backwards compatibility.- Specified by:
clone
in interfacePublicCloneable
- Overrides:
clone
in classObject
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- if cloning is not supported.
-
equals
Tests this object for equality with an arbitrary object. -
hashCode
public int hashCode()Returns a hash code for this instance.
-