Package org.jfree.chart.entity
Class PieSectionEntity
java.lang.Object
org.jfree.chart.entity.ChartEntity
org.jfree.chart.entity.PieSectionEntity
- All Implemented Interfaces:
Serializable
,Cloneable
,PublicCloneable
A chart entity that represents one section within a pie plot.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PieDataset
The dataset.private int
The pie index.private int
The section index.private Comparable
The section key.private static final long
For serialization. -
Constructor Summary
ConstructorsConstructorDescriptionPieSectionEntity
(Shape area, PieDataset dataset, int pieIndex, int sectionIndex, Comparable sectionKey, String toolTipText, String urlText) Creates a new pie section entity. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Ensures symmetry between super/subclass implementations of equals.boolean
Tests this entity for equality with an arbitrary object.Returns the dataset this entity refers to.int
Returns the pie index.int
Returns the section index.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.toString()
Returns a string representing the entity.Methods inherited from class org.jfree.chart.entity.ChartEntity
clone, getArea, getImageMapAreaTag, getShapeCoords, getShapeType, getToolTipText, getURLText, setArea, setToolTipText, setURLText
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor serialization.- See Also:
-
dataset
The dataset. -
pieIndex
private int pieIndexThe pie index. -
sectionIndex
private int sectionIndexThe section index. -
sectionKey
The section key.
-
-
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
-
getDataset
Returns the dataset this entity refers to.- Returns:
- The dataset.
- See Also:
-
setDataset
Sets the dataset this entity refers to.- Parameters:
dataset
- the dataset.- See Also:
-
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.
- See Also:
-
setPieIndex
public void setPieIndex(int index) Sets the pie index.- Parameters:
index
- the new index value.- See Also:
-
getSectionIndex
public int getSectionIndex()Returns the section index.- Returns:
- The section index.
- See Also:
-
setSectionIndex
public void setSectionIndex(int index) Sets the section index.- Parameters:
index
- the section index.- See Also:
-
getSectionKey
Returns the section key.- Returns:
- The section key.
- See Also:
-
setSectionKey
Sets the section key.- Parameters:
key
- the section key.- See Also:
-
equals
Tests this entity for equality with an arbitrary object.- Overrides:
equals
in classChartEntity
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-
canEqual
Ensures symmetry between super/subclass implementations of equals. For more detail, see http://jqno.nl/equalsverifier/manual/inheritance.- Overrides:
canEqual
in classChartEntity
- Parameters:
other
- Object- Returns:
- true ONLY if the parameter is THIS class type
-
hashCode
public int hashCode()Description copied from class:ChartEntity
Returns a hash code for this instance.- Overrides:
hashCode
in classChartEntity
- Returns:
- A hash code.
-
toString
Returns a string representing the entity.- Overrides:
toString
in classChartEntity
- Returns:
- A string representing the entity.
-