KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfree > data > xy > XYInterval


1 /* ===========================================================
2  * JFreeChart : a free chart library for the Java(tm) platform
3  * ===========================================================
4  *
5  * (C) Copyright 2000-2006, by Object Refinery Limited and Contributors.
6  *
7  * Project Info: http://www.jfree.org/jfreechart/index.html
8  *
9  * This library is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation; either version 2.1 of the License, or
12  * (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17  * License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22  * USA.
23  *
24  * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
25  * in the United States and other countries.]
26  *
27  * ---------------
28  * XYInterval.java
29  * ---------------
30  * (C) Copyright 2006, by Object Refinery Limited.
31  *
32  * Original Author: David Gilbert (for Object Refinery Limited);
33  * Contributor(s): -;
34  *
35  * $Id: XYInterval.java,v 1.1.2.1 2006/10/20 15:23:22 mungady Exp $
36  *
37  * Changes
38  * -------
39  * 20-Oct-2006 : Version 1 (DG);
40  *
41  */

42
43 package org.jfree.data.xy;
44
45 import java.io.Serializable JavaDoc;
46
47 /**
48  * An xy-interval. This class is used internally by the
49  * {@link XYIntervalDataItem} class.
50  *
51  * @since 1.0.3
52  */

53 public class XYInterval implements Serializable JavaDoc {
54     
55     /** The lower bound of the x-interval. */
56     private double xLow;
57     
58     /** The upper bound of the y-interval. */
59     private double xHigh;
60     
61     /** The y-value. */
62     private double y;
63     
64     /** The lower bound of the y-interval. */
65     private double yLow;
66     
67     /** The upper bound of the y-interval. */
68     private double yHigh;
69     
70     /**
71      * Creates a new instance of <code>XYInterval</code>.
72      *
73      * @param xLow the lower bound of the x-interval.
74      * @param xHigh the upper bound of the y-interval.
75      * @param y the y-value.
76      * @param yLow the lower bound of the y-interval.
77      * @param yHigh the upper bound of the y-interval.
78      */

79     public XYInterval(double xLow, double xHigh, double y, double yLow,
80             double yHigh) {
81         this.xLow = xLow;
82         this.xHigh = xHigh;
83         this.y = y;
84         this.yLow = yLow;
85         this.yHigh = yHigh;
86     }
87     
88     /**
89      * Returns the lower bound of the x-interval.
90      *
91      * @return The lower bound of the x-interval.
92      */

93     public double getXLow() {
94         return this.xLow;
95     }
96     
97     /**
98      * Returns the upper bound of the x-interval.
99      *
100      * @return The upper bound of the x-interval.
101      */

102     public double getXHigh() {
103         return this.xHigh;
104     }
105
106     /**
107      * Returns the y-value.
108      *
109      * @return The y-value.
110      */

111     public double getY() {
112         return this.y;
113     }
114     
115     /**
116      * Returns the lower bound of the y-interval.
117      *
118      * @return The lower bound of the y-interval.
119      */

120     public double getYLow() {
121         return this.yLow;
122     }
123     
124     /**
125      * Returns the upper bound of the y-interval.
126      *
127      * @return The upper bound of the y-interval.
128      */

129     public double getYHigh() {
130         return this.yHigh;
131     }
132     
133     /**
134      * Tests this instance for equality with an arbitrary object.
135      *
136      * @param obj the object (<code>null</code> permitted).
137      *
138      * @return A boolean.
139      */

140     public boolean equals(Object JavaDoc obj) {
141         if (obj == this) {
142             return true;
143         }
144         if (!(obj instanceof XYInterval)) {
145             return false;
146         }
147         XYInterval that = (XYInterval) obj;
148         if (this.xLow != that.xLow) {
149             return false;
150         }
151         if (this.xHigh != that.xHigh) {
152             return false;
153         }
154         if (this.y != that.y) {
155             return false;
156         }
157         if (this.yLow != that.yLow) {
158             return false;
159         }
160         if (this.yHigh != that.yHigh) {
161             return false;
162         }
163         return true;
164     }
165     
166 }
167
Popular Tags