Module org.jfree.chart
Package org.jfree.chart.entity
Class LegendItemEntity<S extends Comparable<S>>
- java.lang.Object
-
- org.jfree.chart.entity.ChartEntity
-
- org.jfree.chart.entity.LegendItemEntity<S>
-
- Type Parameters:
S- the type for the series keys.
- All Implemented Interfaces:
Serializable,Cloneable,PublicCloneable
public class LegendItemEntity<S extends Comparable<S>> extends ChartEntity implements Cloneable, Serializable
An entity that represents an item (the identifier for a series) within a legend.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LegendItemEntity(Shape area)Creates a legend item entity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()Returns a clone of the entity.booleanequals(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.SgetSeriesKey()Returns the series key that identifies the legend item.voidsetDataset(Dataset dataset)Sets a reference to the dataset that this legend item is derived from.voidsetSeriesKey(S key)Sets the key for the series.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, hashCode, setArea, setToolTipText, setURLText
-
-
-
-
Constructor Detail
-
LegendItemEntity
public LegendItemEntity(Shape area)
Creates a legend item entity.- Parameters:
area- the area.
-
-
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 S getSeriesKey()
Returns the series key that identifies the legend item.- Returns:
- The series key.
- See Also:
setSeriesKey(Comparable)
-
setSeriesKey
public void setSeriesKey(S key)
Sets the key for the series.- Parameters:
key- the key.- See Also:
getSeriesKey()
-
equals
public boolean equals(Object obj)
Tests this object for equality with an arbitrary object.- Overrides:
equalsin classChartEntity- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
clone
public Object clone() throws CloneNotSupportedException
Returns a clone of the entity.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classChartEntity- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if there is a problem cloning the object.
-
toString
public String toString()
Returns a string representing this object (useful for debugging purposes).- Overrides:
toStringin classChartEntity- Returns:
- A string (never
null).
-
-