public class

AbstractXYItemLabelGenerator

extends Object
implements Serializable Cloneable
java.lang.Object
   ↳ org.jfree.chart.labels.AbstractXYItemLabelGenerator
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

A base class for creating item label generators.

Summary

Protected Constructors
AbstractXYItemLabelGenerator()
Creates an item label generator using default number formatters.
AbstractXYItemLabelGenerator(String formatString, NumberFormat xFormat, NumberFormat yFormat)
Creates an item label generator using the specified number formatters.
AbstractXYItemLabelGenerator(String formatString, DateFormat xFormat, NumberFormat yFormat)
Creates an item label generator using the specified number formatters.
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).
AbstractXYItemLabelGenerator(String formatString, DateFormat xFormat, DateFormat yFormat)
Creates an item label generator using the specified number formatters.
Public Methods
Object clone()
Returns an independent copy of the generator.
boolean equals(Object obj)
Tests this object for equality with an arbitrary object.
String generateLabelString(XYDataset dataset, int series, int item)
Generates a label string for an item in the dataset.
String getFormatString()
Returns the format string (this controls the overall structure of the label).
String getNullYString()
Returns the string representing a null value.
DateFormat getXDateFormat()
Returns the date formatter for the x-values.
NumberFormat getXFormat()
Returns the number formatter for the x-values.
DateFormat getYDateFormat()
Returns the date formatter for the y-values.
NumberFormat getYFormat()
Returns the number formatter for the y-values.
int hashCode()
Returns a hash code for this instance.
Protected Methods
Object[] createItemArray(XYDataset dataset, int series, int item)
Creates the array of items that can be passed to the MessageFormat class for creating labels.
[Expand]
Inherited Methods
From class java.lang.Object

Protected Constructors

protected AbstractXYItemLabelGenerator ()

Creates an item label generator using default number formatters.

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 (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).

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

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

protected AbstractXYItemLabelGenerator (String formatString, DateFormat xFormat, DateFormat 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 permitted).
yFormat the format object for the y values (null not permitted).

Public Methods

public Object clone ()

Returns an independent copy of the generator.

Returns
  • A clone.
Throws
CloneNotSupportedException if cloning is not supported.

public boolean equals (Object obj)

Tests this object for equality with an arbitrary object.

Parameters
obj the other object (null permitted).
Returns
  • A boolean.

public String generateLabelString (XYDataset dataset, int series, int item)

Generates a label string for an item in the dataset.

Parameters
dataset the dataset (null not permitted).
series the series (zero-based index).
item the item (zero-based index).
Returns
  • The label (possibly null).

public String getFormatString ()

Returns the format string (this controls the overall structure of the label).

Returns
  • The format string (never null).

public String getNullYString ()

Returns the string representing a null value.

Returns
  • The string representing a null value.

public DateFormat getXDateFormat ()

Returns the date formatter for the x-values.

Returns
  • The date formatter (possibly null).

public NumberFormat getXFormat ()

Returns the number formatter for the x-values.

Returns
  • The number formatter (possibly null).

public DateFormat getYDateFormat ()

Returns the date formatter for the y-values.

Returns
  • The date formatter (possibly null).

public NumberFormat getYFormat ()

Returns the number formatter for the y-values.

Returns
  • The number formatter (possibly null).

public int hashCode ()

Returns a hash code for this instance.

Returns
  • A hash code.

Protected Methods

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.

Parameters
dataset the dataset (null not permitted).
series the series (zero-based index).
item the item (zero-based index).
Returns
  • An array of three items from the dataset formatted as String objects (never null).