Package org.jfree.chart
Class LegendItemCollection
java.lang.Object
org.jfree.chart.LegendItemCollection
- All Implemented Interfaces:
Serializable,Cloneable
A collection of legend items.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new legend item collection, initially empty. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(LegendItem item) Adds a legend item to the collection.voidaddAll(LegendItemCollection collection) Adds the legend items from another collection to this collection.clone()Returns a clone of the collection.booleanTests this collection for equality with an arbitrary object.get(int index) Returns a legend item from the collection.intReturns the number of legend items in the collection.inthashCode()iterator()Returns an iterator that provides access to all the legend items.
-
Constructor Details
-
LegendItemCollection
public LegendItemCollection()Constructs a new legend item collection, initially empty.
-
-
Method Details
-
add
Adds a legend item to the collection.- Parameters:
item- the item to add.
-
addAll
Adds the legend items from another collection to this collection.- Parameters:
collection- the other collection (nullnot permitted).
-
get
Returns a legend item from the collection.- Parameters:
index- the legend item index (zero-based).- Returns:
- The legend item.
-
getItemCount
Returns the number of legend items in the collection.- Returns:
- The item count.
-
iterator
Returns an iterator that provides access to all the legend items.- Returns:
- An iterator.
-
equals
Tests this collection for equality with an arbitrary object. -
hashCode
-
clone
Returns a clone of the collection.- Overrides:
clonein classObject- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if an item in the collection is not cloneable.
-