KickJava   Java API By Example, From Geeks To Geeks.

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


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  * XYDataset.java
29  * --------------
30  * (C) Copyright 2000-2006, by Object Refinery Limited.
31  *
32  * Original Author: David Gilbert (for Object Refinery Limited);
33  * Contributor(s): -;
34  *
35  * $Id: XYDataset.java,v 1.2.2.2 2006/08/03 16:22:40 mungady Exp $
36  *
37  * Changes (from 18-Sep-2001)
38  * --------------------------
39  * 18-Sep-2001 : Added standard header and fixed DOS encoding problem (DG);
40  * 15-Oct-2001 : Moved to a new package (com.jrefinery.data.*) (DG);
41  * 22-Oct-2001 : Renamed DataSource.java --> Dataset.java etc. (DG);
42  * 17-Nov-2001 : Now extends SeriesDataset (DG);
43  * 15-Jul-2004 : Switched getX() with getXValue() and getY() with
44  * getYValue() (DG);
45  * 29-Jul-2004 : Added getDomainOrder() method (DG);
46  * 18-Aug-2004 : Moved from org.jfree.data --> org.jfree.data.xy (DG);
47  *
48  */

49
50 package org.jfree.data.xy;
51
52 import org.jfree.data.DomainOrder;
53 import org.jfree.data.general.SeriesDataset;
54
55 /**
56  * An interface through which data in the form of (x, y) items can be accessed.
57  */

58 public interface XYDataset extends SeriesDataset {
59
60     /**
61      * Returns the order of the domain (or X) values returned by the dataset.
62      *
63      * @return The order (never <code>null</code>).
64      */

65     public DomainOrder getDomainOrder();
66     
67     /**
68      * Returns the number of items in a series.
69      * <br><br>
70      * It is recommended that classes that implement this method should throw
71      * an <code>IllegalArgumentException</code> if the <code>series</code>
72      * argument is outside the specified range.
73      *
74      * @param series the series index (in the range <code>0</code> to
75      * <code>getSeriesCount() - 1</code>).
76      *
77      * @return The item count.
78      */

79     public int getItemCount(int series);
80
81     /**
82      * Returns the x-value for an item within a series. The x-values may or
83      * may not be returned in ascending order, that is up to the class
84      * implementing the interface.
85      *
86      * @param series the series index (in the range <code>0</code> to
87      * <code>getSeriesCount() - 1</code>).
88      * @param item the item index (in the range <code>0</code> to
89      * <code>getItemCount(series)</code>).
90      *
91      * @return The x-value (never <code>null</code>).
92      */

93     public Number JavaDoc getX(int series, int item);
94
95     /**
96      * Returns the x-value for an item within a series.
97      *
98      * @param series the series index (in the range <code>0</code> to
99      * <code>getSeriesCount() - 1</code>).
100      * @param item the item index (in the range <code>0</code> to
101      * <code>getItemCount(series)</code>).
102      *
103      * @return The x-value.
104      */

105     public double getXValue(int series, int item);
106     
107     /**
108      * Returns the y-value for an item within a series.
109      *
110      * @param series the series index (in the range <code>0</code> to
111      * <code>getSeriesCount() - 1</code>).
112      * @param item the item index (in the range <code>0</code> to
113      * <code>getItemCount(series)</code>).
114      *
115      * @return The y-value (possibly <code>null</code>).
116      */

117     public Number JavaDoc getY(int series, int item);
118
119     /**
120      * Returns the y-value (as a double primitive) for an item within a series.
121      *
122      * @param series the series index (in the range <code>0</code> to
123      * <code>getSeriesCount() - 1</code>).
124      * @param item the item index (in the range <code>0</code> to
125      * <code>getItemCount(series)</code>).
126      *
127      * @return The y-value.
128      */

129     public double getYValue(int series, int item);
130     
131 }
132
Popular Tags