org.jfree.chart.entity

Class PieSectionEntity

Implemented Interfaces:
Cloneable, PublicCloneable, Serializable

public class PieSectionEntity
extends ChartEntity
implements Serializable

A chart entity that represents one section within a pie plot.

Constructor Summary

PieSectionEntity(Shape area, PieDataset dataset, int pieIndex, int sectionIndex, Comparable sectionKey, String toolTipText, String urlText)
Creates a new pie section entity.

Method Summary

boolean
equals(Object obj)
Tests this entity for equality with an arbitrary object.
PieDataset
getDataset()
Returns the dataset this entity refers to.
int
getPieIndex()
Returns the pie index.
int
getSectionIndex()
Returns the section index.
Comparable
getSectionKey()
Returns the section key.
int
hashCode()
Returns a hash code for this instance.
void
setDataset(PieDataset dataset)
Sets the dataset this entity refers to.
void
setPieIndex(int index)
Sets the pie index.
void
setSectionIndex(int index)
Sets the section index.
void
setSectionKey(Comparable key)
Sets the section key.
String
toString()
Returns a string representing the entity.

Methods inherited from class org.jfree.chart.entity.ChartEntity

clone, equals, getArea, getImageMapAreaTag, getShapeCoords, getShapeType, getToolTipText, getURLText, hashCode, setArea, setToolTipText, setURLText, toString

Constructor Details

PieSectionEntity

public PieSectionEntity(Shape area,
                        PieDataset dataset,
                        int pieIndex,
                        int sectionIndex,
                        Comparable sectionKey,
                        String toolTipText,
                        String urlText)
Creates a new pie section entity.
Parameters:
area - the area.
dataset - the pie dataset.
pieIndex - the pie index (zero-based).
sectionIndex - the section index (zero-based).
sectionKey - the section key.
toolTipText - the tool tip text.
urlText - the URL text for HTML image maps.

Method Details

equals

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

getDataset

public PieDataset getDataset()
Returns the dataset this entity refers to.
Returns:
The dataset.

getPieIndex

public int getPieIndex()
Returns the pie index. For a regular pie chart, the section index is 0. For a pie chart containing multiple pie plots, the pie index is the row or column index from which the pie data is extracted.
Returns:
The pie index.

getSectionIndex

public int getSectionIndex()
Returns the section index.
Returns:
The section index.

getSectionKey

public Comparable getSectionKey()
Returns the section key.
Returns:
The section key.

hashCode

public int hashCode()
Returns a hash code for this instance.
Overrides:
hashCode in interface ChartEntity
Returns:
A hash code.

setDataset

public void setDataset(PieDataset dataset)
Sets the dataset this entity refers to.
Parameters:
dataset - the dataset.
See Also:
getDataset()

setPieIndex

public void setPieIndex(int index)
Sets the pie index.
Parameters:
index - the new index value.
See Also:
getPieIndex()

setSectionIndex

public void setSectionIndex(int index)
Sets the section index.
Parameters:
index - the section index.

setSectionKey

public void setSectionKey(Comparable key)
Sets the section key.
Parameters:
key - the section key.

toString

public String toString()
Returns a string representing the entity.
Overrides:
toString in interface ChartEntity
Returns:
A string representing the entity.