org.jfree.chart.labels

Class IntervalXYItemLabelGenerator

Implemented Interfaces:
Cloneable, PublicCloneable, Serializable, XYItemLabelGenerator

public class IntervalXYItemLabelGenerator
extends AbstractXYItemLabelGenerator
implements XYItemLabelGenerator, Cloneable, PublicCloneable, Serializable

An item label generator for datasets that implement the IntervalXYDataset interface.
Since:
1.0.10

Field Summary

static String
DEFAULT_ITEM_LABEL_FORMAT
The default item label format.

Constructor Summary

IntervalXYItemLabelGenerator()
Creates an item label generator using default number formatters.
IntervalXYItemLabelGenerator(String formatString, DateFormat xFormat, DateFormat yFormat)
Creates a label generator using the specified date formatters.
IntervalXYItemLabelGenerator(String formatString, DateFormat xFormat, NumberFormat yFormat)
Creates an item label generator using the specified formatters.
IntervalXYItemLabelGenerator(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).
IntervalXYItemLabelGenerator(String formatString, NumberFormat xFormat, NumberFormat yFormat)
Creates an item label generator using the specified number formatters.

Method Summary

Object
clone()
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 the MessageFormat class for creating labels.
boolean
equals(Object obj)
Tests this object for equality with an arbitrary object.
String
generateLabel(XYDataset dataset, int series, int item)
Generates the item label text for an item in a dataset.

Methods inherited from class org.jfree.chart.labels.AbstractXYItemLabelGenerator

clone, createItemArray, equals, generateLabelString, getFormatString, getNullYString, getXDateFormat, getXFormat, getYDateFormat, getYFormat, hashCode

Field Details

DEFAULT_ITEM_LABEL_FORMAT

public static final String DEFAULT_ITEM_LABEL_FORMAT
The default item label format.

Constructor Details

IntervalXYItemLabelGenerator

public IntervalXYItemLabelGenerator()
Creates an item label generator using default number formatters.

IntervalXYItemLabelGenerator

public IntervalXYItemLabelGenerator(String formatString,
                                    DateFormat xFormat,
                                    DateFormat yFormat)
Creates a label generator using the specified date formatters.
Parameters:
formatString - the label format string (null not permitted).
xFormat - the format object for the x values (null not permitted).
yFormat - the format object for the y values (null not permitted).

IntervalXYItemLabelGenerator

public IntervalXYItemLabelGenerator(String formatString,
                                    DateFormat xFormat,
                                    NumberFormat yFormat)
Creates an item label generator using the specified formatters.
Parameters:
formatString - the item label format string (null not permitted).
xFormat - the format object for the x values (null not permitted).
yFormat - the format object for the y values (null not permitted).

IntervalXYItemLabelGenerator

public IntervalXYItemLabelGenerator(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 (null not permitted).
xFormat - the format object for the x values (null permitted).
yFormat - the format object for the y values (null not permitted).

IntervalXYItemLabelGenerator

public IntervalXYItemLabelGenerator(String formatString,
                                    NumberFormat xFormat,
                                    NumberFormat yFormat)
Creates an item label generator using the specified number formatters.
Parameters:
formatString - the item label format string (null not permitted).
xFormat - the format object for the x values (null not permitted).
yFormat - the format object for the y values (null not permitted).

Method Details

clone

public Object clone()
            throws CloneNotSupportedException
Returns an independent copy of the generator.
Overrides:
clone in interface AbstractXYItemLabelGenerator
Returns:
A clone.

createItemArray

protected Object[] createItemArray(XYDataset dataset,
                                   int series,
                                   int item)
Creates the array of items that can be passed to the MessageFormat class for creating labels.
Overrides:
createItemArray in interface AbstractXYItemLabelGenerator
Parameters:
dataset - the dataset (null not permitted).
series - the series (zero-based index).
item - the item (zero-based index).
Returns:
An array of seven items from the dataset formatted as String objects (never null).

equals

public boolean equals(Object obj)
Tests this object for equality with an arbitrary object.
Overrides:
equals in interface AbstractXYItemLabelGenerator
Parameters:
obj - the other object (null permitted).
Returns:
A boolean.

generateLabel

public String generateLabel(XYDataset dataset,
                            int series,
                            int item)
Generates the item label text for an item in a dataset.
Specified by:
generateLabel in interface XYItemLabelGenerator
Parameters:
dataset - the dataset (null not permitted).
series - the series index (zero-based).
item - the item index (zero-based).
Returns:
The label text (possibly null).