1 | public class XIntervalDataItem extends ComparableObjectItem {↵ | | 1 | public class YIntervalDataItem extends ComparableObjectItem {↵
|
|
2 | /** ↵ | | 2 | /** ↵
|
3 | * Creates a new instance of <code>XIntervalDataItem</code>.↵ | | 3 | * Creates a new instance of <code>YIntervalItem</code>.↵
|
4 | *↵ | | 4 | *↵
|
5 | * @param x the x-value.↵ | | 5 | * @param x the x-value.↵
|
6 | * @param x↵ | | 6 | * @param y the y-value.↵
|
7 | Low the lower bound of the x-interval.↵ | | 7 | * @param yLow the lower bound of the y-interval.↵
|
8 | * @param xHigh the upper bound of the x-interval.↵ | | 8 | * @param yHigh the upper bound of the y-interval.↵
|
9 | * @param y the y-value.↵ | | |
|
10 | */↵ | | 9 | */↵
|
11 | public XIntervalDataItem(double x, double xLow, double xHigh, double y) {↵ | | 10 | public YIntervalDataItem(double x, double y, double yLow, double yHigh) {↵
|
12 | super(new Double(x), new YWithXInterval(y, xLow, xHigh));↵ | | 11 | super(new Double(x), new YInterval(y, yLow, yHigh));↵
|
13 | }↵ | | 12 | }↵
|
14 | ↵ | | 13 | ↵
|
15 | /**↵ | | 14 | /**↵
|
16 | * Returns the x-value.↵ | | 15 | * Returns the x-value.↵
|
17 | *↵ | | 16 | *↵
|
18 | * @return The x-value (never <code>null</code>).↵ | | 17 | * @return The x-value (never <code>null</code>).↵
|
19 | */↵ | | 18 | */↵
|
20 | public Number getX() {↵ | | 19 | public Double getX() {↵
|
21 | return (Number) getComparable();↵ | | 20 | return (Double) getComparable();↵
|
22 | }↵ | | 21 | }↵
|
23 | ↵ | | 22 | ↵
|
24 | /**↵ | | 23 | /**↵
|
25 | * Returns the y-value.↵ | | 24 | * Returns the y-value.↵
|
26 | *↵ | | 25 | *↵
|
27 | * @return The y-value.↵ | | 26 | * @return The y-value.↵
|
28 | */↵ | | 27 | */↵
|
29 | public double getYValue() {↵ | | 28 | public double getYValue() {↵
|
30 | YWithXInterval interval = (YWithXInterval) getObject();↵ | | 29 | YInterval interval = (YInterval) getObject();↵
|
31 | if (interval != null) {↵ | | 30 | if (interval != null) {↵
|
32 | return interval.getY();↵ | | 31 | return interval.getY();↵
|
33 | }↵ | | 32 | }↵
|
34 | else {↵ | | 33 | else {↵
|
35 | return Double.NaN;↵ | | 34 | return Double.NaN;↵
|
36 | }↵ | | 35 | }↵
|
37 | }↵ | | 36 | }↵
|
38 | ↵ | | 37 | ↵
|
39 | /**↵ | | 38 | /**↵
|
40 | * Returns the lower bound of the x-interval.↵ | | 39 | * Returns the lower bound of the y-interval.↵
|
41 | *↵ | | 40 | *↵
|
42 | * @return The lower bound of the x-interval.↵ | | 41 | * @return The lower bound of the y-interval.↵
|
43 | */↵ | | 42 | */↵
|
44 | public double getXLowValue() {↵ | | 43 | public double getYLowValue() {↵
|
45 | YWithXInterval interval = (YWithXInterval) getObject();↵ | | 44 | YInterval interval = (YInterval) getObject();↵
|
46 | if (interval != null) {↵ | | 45 | if (interval != null) {↵
|
47 | return interval.getXLow();↵ | | 46 | return interval.getYLow();↵
|
48 | }↵ | | 47 | }↵
|
49 | else {↵ | | 48 | else {↵
|
50 | return Double.NaN;↵ | | 49 | return Double.NaN;↵
|
51 | }↵ | | 50 | }↵
|
52 | }↵ | | 51 | }↵
|
53 | ↵ | | 52 | ↵
|
54 | /**↵ | | 53 | /**↵
|
55 | * Returns the upper bound of the x-interval.↵ | | 54 | * Returns the upper bound of the y-interval.↵
|
56 | *↵ | | 55 | *↵
|
57 | * @return The upper bound of the x-interval.↵ | | 56 | * @return The upper bound of the y-interval.↵
|
58 | */↵ | | 57 | */↵
|
59 | public double getXHighValue() {↵ | | 58 | public double getYHighValue() {↵
|
60 | YWithXInterval interval = (YWithXInterval) getObject();↵ | | 59 | YInterval interval = (YInterval) getObject();↵
|
61 | if (interval != null) {↵ | | 60 | if (interval != null) {↵
|
62 | return interval.getXHigh();↵ | | 61 | return interval.getYHigh();↵
|
63 | }↵ | | 62 | }↵
|
64 | else {↵ | | 63 | else {↵
|
65 | return Double.NaN | | 64 | return Double.NaN
|