public abstract class

AbstractCategoryItemLabelGenerator

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

Class Overview

A base class that can be used to create a label or tooltip generator that can be assigned to a CategoryItemRenderer.

Summary

Protected Constructors
AbstractCategoryItemLabelGenerator(String labelFormat, NumberFormat formatter)
Creates a label generator with the specified number formatter.
AbstractCategoryItemLabelGenerator(String labelFormat, NumberFormat formatter, NumberFormat percentFormatter)
Creates a label generator with the specified number formatter.
AbstractCategoryItemLabelGenerator(String labelFormat, DateFormat formatter)
Creates a label generator with the specified date formatter.
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 generateColumnLabel(CategoryDataset dataset, int column)
Generates a label for the specified row.
String generateRowLabel(CategoryDataset dataset, int row)
Generates a label for the specified row.
DateFormat getDateFormat()
Returns the date formatter.
String getLabelFormat()
Returns the label format string.
NumberFormat getNumberFormat()
Returns the number formatter.
int hashCode()
Returns a hash code for this instance.
Protected Methods
Object[] createItemArray(CategoryDataset dataset, int row, int column)
Creates the array of items that can be passed to the MessageFormat class for creating labels.
String generateLabelString(CategoryDataset dataset, int row, int column)
Generates a for the specified item.
[Expand]
Inherited Methods
From class java.lang.Object

Protected Constructors

protected AbstractCategoryItemLabelGenerator (String labelFormat, NumberFormat formatter)

Creates a label generator with the specified number formatter.

Parameters
labelFormat the label format string (null not permitted).
formatter the number formatter (null not permitted).

protected AbstractCategoryItemLabelGenerator (String labelFormat, NumberFormat formatter, NumberFormat percentFormatter)

Creates a label generator with the specified number formatter.

Parameters
labelFormat the label format string (null not permitted).
formatter the number formatter (null not permitted).
percentFormatter the percent formatter (null not permitted).

protected AbstractCategoryItemLabelGenerator (String labelFormat, DateFormat formatter)

Creates a label generator with the specified date formatter.

Parameters
labelFormat the label format string (null not permitted).
formatter the date formatter (null not permitted).

Public Methods

public Object clone ()

Returns an independent copy of the generator.

Returns
  • A clone.
Throws
CloneNotSupportedException should not happen.

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 generateColumnLabel (CategoryDataset dataset, int column)

Generates a label for the specified row.

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

public String generateRowLabel (CategoryDataset dataset, int row)

Generates a label for the specified row.

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

public DateFormat getDateFormat ()

Returns the date formatter.

Returns
  • The date formatter (possibly null).

public String getLabelFormat ()

Returns the label format string.

Returns
  • The label format string (never null).

public NumberFormat getNumberFormat ()

Returns the number formatter.

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 (CategoryDataset dataset, int row, int column)

Creates the array of items that can be passed to the MessageFormat class for creating labels.

Parameters
dataset the dataset (null not permitted).
row the row index (zero-based).
column the column index (zero-based).
Returns
  • The items (never null).

protected String generateLabelString (CategoryDataset dataset, int row, int column)

Generates a for the specified item.

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