1 45 46 package org.jfree.chart; 47 48 import java.io.Serializable ; 49 import java.util.Iterator ; 50 import java.util.List ; 51 52 55 public class LegendItemCollection implements Cloneable , Serializable { 56 57 58 private static final long serialVersionUID = 1365215565589815953L; 59 60 61 private List items; 62 63 66 public LegendItemCollection() { 67 this.items = new java.util.ArrayList (); 68 } 69 70 75 public void add(LegendItem item) { 76 this.items.add(item); 77 } 78 79 84 public void addAll(LegendItemCollection collection) { 85 this.items.addAll(collection.items); 86 } 87 88 95 public LegendItem get(int index) { 96 return (LegendItem) this.items.get(index); 97 } 98 99 104 public int getItemCount() { 105 return this.items.size(); 106 } 107 108 113 public Iterator iterator() { 114 return this.items.iterator(); 115 } 116 117 124 public boolean equals(Object obj) { 125 if (obj == this) { 126 return true; 127 } 128 if (!(obj instanceof LegendItemCollection)) { 129 return false; 130 } 131 LegendItemCollection that = (LegendItemCollection) obj; 132 if (!this.items.equals(that.items)) { 133 return false; 134 } 135 return true; 136 } 137 138 146 public Object clone() throws CloneNotSupportedException { 147 return super.clone(); 148 } 149 150 } 151 | Popular Tags |