Package org.jfree.chart.entity
Class PieSectionEntity
- java.lang.Object
-
- org.jfree.chart.entity.ChartEntity
-
- org.jfree.chart.entity.PieSectionEntity
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,PublicCloneable
public class PieSectionEntity extends ChartEntity implements java.io.Serializable
A chart entity that represents one section within a pie plot.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private PieDatasetdatasetThe dataset.private intpieIndexThe pie index.private intsectionIndexThe section index.private java.lang.ComparablesectionKeyThe section key.private static longserialVersionUIDFor serialization.
-
Constructor Summary
Constructors Constructor Description PieSectionEntity(java.awt.Shape area, PieDataset dataset, int pieIndex, int sectionIndex, java.lang.Comparable sectionKey, java.lang.String toolTipText, java.lang.String urlText)Creates a new pie section entity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanEqual(java.lang.Object other)Ensures symmetry between super/subclass implementations of equals.booleanequals(java.lang.Object obj)Tests this entity for equality with an arbitrary object.PieDatasetgetDataset()Returns the dataset this entity refers to.intgetPieIndex()Returns the pie index.intgetSectionIndex()Returns the section index.java.lang.ComparablegetSectionKey()Returns the section key.inthashCode()Returns a hash code for this instance.voidsetDataset(PieDataset dataset)Sets the dataset this entity refers to.voidsetPieIndex(int index)Sets the pie index.voidsetSectionIndex(int index)Sets the section index.voidsetSectionKey(java.lang.Comparable key)Sets the section key.java.lang.StringtoString()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 Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
dataset
private PieDataset dataset
The dataset.
-
pieIndex
private int pieIndex
The pie index.
-
sectionIndex
private int sectionIndex
The section index.
-
sectionKey
private java.lang.Comparable sectionKey
The section key.
-
-
Constructor Detail
-
PieSectionEntity
public PieSectionEntity(java.awt.Shape area, PieDataset dataset, int pieIndex, int sectionIndex, java.lang.Comparable sectionKey, java.lang.String toolTipText, java.lang.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 Detail
-
getDataset
public PieDataset getDataset()
Returns the dataset this entity refers to.- Returns:
- The dataset.
- See Also:
setDataset(PieDataset)
-
setDataset
public void setDataset(PieDataset dataset)
Sets the dataset this entity refers to.- Parameters:
dataset- the dataset.- See Also:
getDataset()
-
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(int)
-
setPieIndex
public void setPieIndex(int index)
Sets the pie index.- Parameters:
index- the new index value.- See Also:
getPieIndex()
-
getSectionIndex
public int getSectionIndex()
Returns the section index.- Returns:
- The section index.
- See Also:
setSectionIndex(int)
-
setSectionIndex
public void setSectionIndex(int index)
Sets the section index.- Parameters:
index- the section index.- See Also:
getSectionIndex()
-
getSectionKey
public java.lang.Comparable getSectionKey()
Returns the section key.- Returns:
- The section key.
- See Also:
setSectionKey(Comparable)
-
setSectionKey
public void setSectionKey(java.lang.Comparable key)
Sets the section key.- Parameters:
key- the section key.- See Also:
getSectionKey()
-
equals
public boolean equals(java.lang.Object obj)
Tests this entity for equality with an arbitrary object.- Overrides:
equalsin classChartEntity- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
canEqual
public boolean canEqual(java.lang.Object other)
Ensures symmetry between super/subclass implementations of equals. For more detail, see http://jqno.nl/equalsverifier/manual/inheritance.- Overrides:
canEqualin classChartEntity- Parameters:
other- Object- Returns:
- true ONLY if the parameter is THIS class type
-
hashCode
public int hashCode()
Description copied from class:ChartEntityReturns a hash code for this instance.- Overrides:
hashCodein classChartEntity- Returns:
- A hash code.
-
toString
public java.lang.String toString()
Returns a string representing the entity.- Overrides:
toStringin classChartEntity- Returns:
- A string representing the entity.
-
-