KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jrobin > graph > Plottable


1 /* ============================================================
2  * JRobin : Pure java implementation of RRDTool's functionality
3  * ============================================================
4  *
5  * Project Info: http://www.jrobin.org
6  * Project Lead: Sasa Markovic (saxon@jrobin.org)
7  *
8  * Developers: Sasa Markovic (saxon@jrobin.org)
9  * Arne Vandamme (cobralord@jrobin.org)
10  *
11  * (C) Copyright 2003, by Sasa Markovic.
12  *
13  * This library is free software; you can redistribute it and/or modify it under the terms
14  * of the GNU Lesser General Public License as published by the Free Software Foundation;
15  * either version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
18  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19  * See the GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public License along with this
22  * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
23  * Boston, MA 02111-1307, USA.
24  */

25 package org.jrobin.graph;
26
27 /**
28  * <p>Interface to be used for custom datasources.
29  * If you wish to use a custom datasource in a graph, you should create a class implementing this interface
30  * that represents that datasource, and then pass this class on to the RrdGraphDef.</p>
31  *
32  * @author Arne Vandamme <cobralord@cherrymon.org>
33  */

34 public abstract class Plottable
35 {
36     /**
37      * Retrieves datapoint value based on a given timestamp.
38      * Use this method if you only have one series of data in this class.
39      * @param timestamp Timestamp in seconds for the datapoint.
40      * @return Double value of the datapoint.
41      */

42     public double getValue( long timestamp ) {
43         return Double.NaN;
44     }
45     
46     /**
47      * Retrieves datapoint value based on a given timestamp.
48      * @param timestamp Timestamp in seconds for the datapoint.
49      * @param index Integer referring to the series containing the specific datapoint.
50      * @return Double value of the datapoint.
51      */

52     public double getValue( long timestamp, int index ) {
53         return Double.NaN;
54     }
55     
56     /**
57      * Retrieves datapoint value based on a given timestamp.
58      * @param timestamp Timestamp in seconds for the datapoint.
59      * @param fieldName String that refers to the series containing the datapoint.
60      * @return Double value of the datapoint.
61      */

62     public double getValue( long timestamp, String JavaDoc fieldName ) {
63         return Double.NaN;
64     }
65 }
66
Popular Tags