1 | public class YInterval implements Serializable {↵ | | 1 | public class YWithXInterval implements Serializable {↵
|
2 | ↵ | | 2 | ↵
|
3 | /** The y-value. */↵ | | 3 | /** The y-value. */↵
|
4 | private double y;↵ | | 4 | private double y;↵
|
5 | ↵ | | 5 | ↵
|
6 | /** The lower bound of the y-interval. */↵ | | 6 | /** The lower bound of the x-interval. */↵
|
7 | private double yLow;↵ | | 7 | private double xLow;↵
|
8 | ↵ | | 8 | ↵
|
9 | /** The upper bound of the y-interval. */↵ | | 9 | /** The upper bound of the x-interval. */↵
|
10 | private double yHigh;↵ | | 10 | private double xHigh;↵
|
11 | ↵ | | 11 | ↵
|
12 | /** ↵ | | 12 | /** ↵
|
13 | * Creates a new instance of <code>YInterval</code>.↵ | | 13 | * Creates a new instance of <code>YWithXInterval</code>.↵
|
14 | *↵ | | 14 | *↵
|
15 | * @param y the y-value.↵ | | 15 | * @param y the y-value.↵
|
16 | * @param yLow the lower bound of the y-interval.↵ | | 16 | * @param xLow the lower bound of the x-interval.↵
|
17 | * @param yHigh the upper bound of the y-interval. ↵ | | 17 | * @param xHigh the upper bound of the x-interval. ↵
|
18 | */↵ | | 18 | */↵
|
19 | public YInterval(double y, double yLow, double yHigh) {↵ | | 19 | public YWithXInterval(double y, double xLow, double xHigh) {↵
|
20 | this.y = y;↵ | | 20 | this.y = y;↵
|
21 | this.yLow = yLow;↵ | | 21 | this.xLow = xLow;↵
|
22 | this.yHigh = yHigh;↵ | | 22 | this.xHigh = xHigh;↵
|
23 | }↵ | | 23 | }↵
|
24 | ↵ | | 24 | ↵
|
25 | /**↵ | | 25 | /**↵
|
26 | * Returns the y-value.↵ | | 26 | * Returns the y-value.↵
|
27 | *↵ | | 27 | *↵
|
28 | * @return The y-value.↵ | | 28 | * @return The y-value.↵
|
29 | */↵ | | 29 | */↵
|
30 | public double getY() {↵ | | 30 | public double getY() {↵
|
31 | return this.y;↵ | | 31 | return this.y;↵
|
32 | }↵ | | 32 | }↵
|
33 | ↵ | | 33 | ↵
|
34 | /**↵ | | 34 | /**↵
|
35 | * Returns the lower bound of the y-interval.↵ | | 35 | * Returns the lower bound of the x-interval.↵
|
36 | *↵ | | 36 | *↵
|
37 | * @return The lower bound of the y-interval.↵ | | 37 | * @return The lower bound of the x-interval.↵
|
38 | */↵ | | 38 | */↵
|
39 | public double getYLow() {↵ | | 39 | public double getXLow() {↵
|
40 | return this.yLow;↵ | | 40 | return this.xLow;↵
|
41 | }↵ | | 41 | }↵
|
42 | ↵ | | 42 | ↵
|
43 | /**↵ | | 43 | /**↵
|
44 | * Returns the upper bound of the y-interval.↵ | | 44 | * Returns the upper bound of the x-interval.↵
|
45 | *↵ | | 45 | *↵
|
46 | * @return The upper bound of the y-interval.↵ | | 46 | * @return The upper bound of the x-interval.↵
|
47 | */↵ | | 47 | */↵
|
48 | public double getYHigh() {↵ | | 48 | public double getXHigh() {↵
|
49 | return this.yHigh;↵ | | 49 | return this.xHigh;↵
|
50 | }↵ | | 50 | }↵
|
51 | ↵ | | 51 | ↵
|
52 | /**↵ | | 52 | /**↵
|
53 | * Tests this instance for equality with an arbitrary object.↵ | | 53 | * Tests this instance for equality with an arbitrary object.↵
|
54 | *↵ | | 54 | *↵
|
55 | * @param obj the object (<code>null</code> permitted).↵ | | 55 | * @param obj the object (<code>null</code> permitted).↵
|
56 | *↵ | | 56 | *↵
|
57 | * @return A boolean.↵ | | 57 | * @return A boolean.↵
|
58 | */↵ | | 58 | */↵
|
59 | public boolean equals(Object obj) {↵ | | 59 | public boolean equals(Object obj) {↵
|
60 | if (obj == this) {↵ | | 60 | if (obj == this) {↵
|
61 | return true;↵ | | 61 | return true;↵
|
62 | }↵ | | 62 | }↵
|
63 | if (!(obj instanceof YInterval)) {↵ | | 63 | if (!(obj instanceof YWithXInterval)) {↵
|
64 | return false;↵ | | 64 | return false;↵
|
65 | }↵ | | 65 | }↵
|
66 | YInterval that = (YInterval) obj;↵ | | 66 | YWithXInterval that = (YWithXInterval) obj;↵
|
67 | if (this.y != that.y) {↵ | | 67 | if (this.y != that.y) {↵
|
68 | return false;↵ | | 68 | return false;↵
|
69 | }↵ | | 69 | }↵
|
70 | if (this.yLow != that.yLow) {↵ | | 70 | if (this.xLow != that.xLow) {↵
|
71 | return false;↵ | | 71 | return false;↵
|
72 | }↵ | | 72 | }↵
|
73 | if (this.yHigh != that.yHigh) {↵ | | 73 | if (this.xHigh != that.xHigh) {↵
|
74 | return false;↵ | | 74 | return false;↵
|
75 | }↵ | | 75 | }↵
|
76 | return true | | 76 | return true
|