Package org.jfree.chart.entity
Class LegendItemEntity
- java.lang.Object
-
- org.jfree.chart.entity.ChartEntity
-
- org.jfree.chart.entity.LegendItemEntity
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,PublicCloneable
public class LegendItemEntity extends ChartEntity implements java.lang.Cloneable, java.io.Serializable
An entity that represents an item within a legend.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private DatasetdatasetThe dataset.private static longserialVersionUIDFor serialization.private java.lang.ComparableseriesKeyThe series key.
-
Constructor Summary
Constructors Constructor Description LegendItemEntity(java.awt.Shape area)Creates a legend item 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.java.lang.Objectclone()Returns a clone of the entity.booleanequals(java.lang.Object obj)Tests this object for equality with an arbitrary object.DatasetgetDataset()Returns a reference to the dataset that this legend item is derived from.java.lang.ComparablegetSeriesKey()Returns the series key that identifies the legend item.inthashCode()Returns a hash code for this instance.voidsetDataset(Dataset dataset)Sets a reference to the dataset that this legend item is derived from.voidsetSeriesKey(java.lang.Comparable key)Sets the key for the series.java.lang.StringtoString()Returns a string representing this object (useful for debugging purposes).-
Methods inherited from class org.jfree.chart.entity.ChartEntity
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 Dataset dataset
The dataset.
-
seriesKey
private java.lang.Comparable seriesKey
The series key.
-
-
Method Detail
-
getDataset
public Dataset getDataset()
Returns a reference to the dataset that this legend item is derived from.- Returns:
- The dataset.
- See Also:
setDataset(Dataset)
-
setDataset
public void setDataset(Dataset dataset)
Sets a reference to the dataset that this legend item is derived from.- Parameters:
dataset- the dataset.
-
getSeriesKey
public java.lang.Comparable getSeriesKey()
Returns the series key that identifies the legend item.- Returns:
- The series key.
- See Also:
setSeriesKey(Comparable)
-
setSeriesKey
public void setSeriesKey(java.lang.Comparable key)
Sets the key for the series.- Parameters:
key- the key.- See Also:
getSeriesKey()
-
equals
public boolean equals(java.lang.Object obj)
Tests this object 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.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone of the entity.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classChartEntity- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException- if there is a problem cloning the object.
-
toString
public java.lang.String toString()
Returns a string representing this object (useful for debugging purposes).- Overrides:
toStringin classChartEntity- Returns:
- A string (never
null).
-
-