KickJava   Java API By Example, From Geeks To Geeks.

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


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  * (C) Copyright 2003, by Sasa Markovic.
9  *
10  * This library is free software; you can redistribute it and/or modify it under the terms
11  * of the GNU Lesser General Public License as published by the Free Software Foundation;
12  * either version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
15  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License along with this
19  * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */

22 package org.jrobin.graph;
23
24 /**
25  * <p>Represents a time grid marker (grid line with or without label on the X axis).</p>
26  *
27  * @author Arne Vandamme (cobralord@jrobin.org)
28  */

29 class TimeMarker
30 {
31     // ================================================================
32
// -- Members
33
// ================================================================
34
private long timestamp = 0;
35     private String JavaDoc text = "";
36     private boolean label = false;
37     
38     
39     // ================================================================
40
// -- Constructors
41
// ================================================================
42
/**
43      * @param ts Timestamp in seconds where this line should be set.
44      * @param v Text of a possible label for this marker.
45      * @param l True if this marker is a major grid line and is accompanied by a label.
46      */

47     TimeMarker( long ts, String JavaDoc v, boolean l )
48     {
49         this.label = l;
50         timestamp = ts;
51         text = v;
52     }
53     
54     
55     // ================================================================
56
// -- Protected methods
57
// ================================================================
58
boolean isLabel()
59     {
60         return label;
61     }
62     
63     long getTimestamp()
64     {
65         return timestamp / 1000;
66     }
67     
68     String JavaDoc getLabel()
69     {
70         return text;
71     }
72 }
73
Popular Tags