1 42 43 package org.jfree.data.xy; 44 45 import org.jfree.data.ComparableObjectItem; 46 47 52 public class XYIntervalDataItem extends ComparableObjectItem { 53 54 64 public XYIntervalDataItem(double x, double xLow, double xHigh, double y, 65 double yLow, double yHigh) { 66 super(new Double (x), new XYInterval(xLow, xHigh, y, yLow, yHigh)); 67 } 68 69 74 public Double getX() { 75 return (Double ) getComparable(); 76 } 77 78 83 public double getYValue() { 84 XYInterval interval = (XYInterval) getObject(); 85 if (interval != null) { 86 return interval.getY(); 87 } 88 else { 89 return Double.NaN; 90 } 91 } 92 93 98 public double getXLowValue() { 99 XYInterval interval = (XYInterval) getObject(); 100 if (interval != null) { 101 return interval.getXLow(); 102 } 103 else { 104 return Double.NaN; 105 } 106 } 107 108 113 public double getXHighValue() { 114 XYInterval interval = (XYInterval) getObject(); 115 if (interval != null) { 116 return interval.getXHigh(); 117 } 118 else { 119 return Double.NaN; 120 } 121 } 122 123 128 public double getYLowValue() { 129 XYInterval interval = (XYInterval) getObject(); 130 if (interval != null) { 131 return interval.getYLow(); 132 } 133 else { 134 return Double.NaN; 135 } 136 } 137 138 143 public double getYHighValue() { 144 XYInterval interval = (XYInterval) getObject(); 145 if (interval != null) { 146 return interval.getYHigh(); 147 } 148 else { 149 return Double.NaN; 150 } 151 } 152 153 } 154 | Popular Tags |