1 51 52 package org.jfree.chart.entity; 53 54 import java.awt.Shape ; 55 import java.io.Serializable ; 56 57 import org.jfree.data.category.CategoryDataset; 58 import org.jfree.util.ObjectUtilities; 59 60 63 public class CategoryItemEntity extends ChartEntity 64 implements Cloneable , Serializable { 65 66 67 private static final long serialVersionUID = -8657249457902337349L; 68 69 70 private transient CategoryDataset dataset; 71 72 73 private int series; 74 75 76 private Object category; 77 78 79 private int categoryIndex; 80 81 92 public CategoryItemEntity(Shape area, String toolTipText, String urlText, 93 CategoryDataset dataset, 94 int series, Object category, int categoryIndex) { 95 96 super(area, toolTipText, urlText); 97 this.dataset = dataset; 98 this.series = series; 99 this.category = category; 100 this.categoryIndex = categoryIndex; 101 102 } 103 104 109 public CategoryDataset getDataset() { 110 return this.dataset; 111 } 112 113 118 public void setDataset(CategoryDataset dataset) { 119 this.dataset = dataset; 120 } 121 122 127 public int getSeries() { 128 return this.series; 129 } 130 131 136 public void setSeries(int series) { 137 this.series = series; 138 } 139 140 145 public Object getCategory() { 146 return this.category; 147 } 148 149 154 public void setCategory(Object category) { 155 this.category = category; 156 } 157 158 163 public int getCategoryIndex() { 164 return this.categoryIndex; 165 } 166 167 172 public void setCategoryIndex(int index) { 173 this.categoryIndex = index; 174 } 175 176 182 public String toString() { 183 return "Category Item: series=" + this.series 184 + ", category=" + this.category.toString(); 185 } 186 187 194 public boolean equals(Object obj) { 195 if (obj == this) { 196 return true; 197 } 198 if (obj instanceof CategoryItemEntity && super.equals(obj)) { 199 CategoryItemEntity cie = (CategoryItemEntity) obj; 200 if (this.categoryIndex != cie.categoryIndex) { 201 return false; 202 } 203 if (this.series != cie.series) { 204 return false; 205 } 206 if (!ObjectUtilities.equal(this.category, cie.category)) { 207 return false; 208 } 209 return true; 210 } 211 return false; 212 } 213 214 } 215 | Popular Tags |