Class LegendItemCollection

java.lang.Object
org.jfree.chart.LegendItemCollection
All Implemented Interfaces:
Serializable, Cloneable

public class LegendItemCollection extends Object implements Cloneable, Serializable
A collection of legend items.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private List
    Storage for the legend items.
    private static final long
    For serialization.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new legend item collection, initially empty.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds a legend item to the collection.
    void
    Adds the legend items from another collection to this collection.
    Returns a clone of the collection.
    boolean
    Tests this collection for equality with an arbitrary object.
    get(int index)
    Returns a legend item from the collection.
    int
    Returns the number of legend items in the collection.
    int
     
    Returns an iterator that provides access to all the legend items.

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For serialization.
      See Also:
    • items

      private List items
      Storage for the legend items.
  • Constructor Details

    • LegendItemCollection

      public LegendItemCollection()
      Constructs a new legend item collection, initially empty.
  • Method Details

    • add

      public void add(LegendItem item)
      Adds a legend item to the collection.
      Parameters:
      item - the item to add.
    • addAll

      public void addAll(LegendItemCollection collection)
      Adds the legend items from another collection to this collection.
      Parameters:
      collection - the other collection (null not permitted).
    • get

      public LegendItem get(int index)
      Returns a legend item from the collection.
      Parameters:
      index - the legend item index (zero-based).
      Returns:
      The legend item.
    • getItemCount

      public int getItemCount()
      Returns the number of legend items in the collection.
      Returns:
      The item count.
    • iterator

      public Iterator iterator()
      Returns an iterator that provides access to all the legend items.
      Returns:
      An iterator.
    • equals

      public boolean equals(Object obj)
      Tests this collection for equality with an arbitrary object.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object (null permitted).
      Returns:
      A boolean.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public Object clone() throws CloneNotSupportedException
      Returns a clone of the collection.
      Overrides:
      clone in class Object
      Returns:
      A clone.
      Throws:
      CloneNotSupportedException - if an item in the collection is not cloneable.