1 51 52 package org.jfree.chart.entity; 53 54 import java.awt.Shape ; 55 56 import org.jfree.data.xy.XYDataset; 57 58 62 public class XYItemEntity extends ChartEntity { 63 64 65 private static final long serialVersionUID = -3870862224880283771L; 66 67 68 private transient XYDataset dataset; 69 70 71 private int series; 72 73 74 private int item; 75 76 86 public XYItemEntity(Shape area, 87 XYDataset dataset, int series, int item, 88 String toolTipText, String urlText) { 89 super(area, toolTipText, urlText); 90 this.dataset = dataset; 91 this.series = series; 92 this.item = item; 93 } 94 95 100 public XYDataset getDataset() { 101 return this.dataset; 102 } 103 104 109 public void setDataset(XYDataset dataset) { 110 this.dataset = dataset; 111 } 112 113 118 public int getSeriesIndex() { 119 return this.series; 120 } 121 122 127 public void setSeriesIndex(int series) { 128 this.series = series; 129 } 130 131 136 public int getItem() { 137 return this.item; 138 } 139 140 145 public void setItem(int item) { 146 this.item = item; 147 } 148 149 156 public boolean equals(Object obj) { 157 if (obj == this) { 158 return true; 159 } 160 if (obj instanceof XYItemEntity && super.equals(obj)) { 161 XYItemEntity ie = (XYItemEntity) obj; 162 if (this.series != ie.series) { 163 return false; 164 } 165 if (this.item != ie.item) { 166 return false; 167 } 168 return true; 169 } 170 return false; 171 } 172 173 179 public String toString() { 180 return "XYItemEntity: series = " + getSeriesIndex() + ", item = " 181 + getItem() + ", dataset = " + getDataset(); 182 } 183 184 } 185 | Popular Tags |