KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > info > monitorenter > gui > chart > io > AStaticDataCollector


1 /*
2  * AbstractDataCollector.java a configurable threaded collector for tracepoints in jchart2d.
3  * Copyright (C) Achim Westermann, created on 10.12.2004, 14:48:09
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * If you modify or optimize the code in a useful way please let me know.
20  * Achim.Westermann@gmx.de
21  *
22  */

23 package info.monitorenter.gui.chart.io;
24
25 import info.monitorenter.gui.chart.ITrace2D;
26
27 import java.io.IOException JavaDoc;
28
29
30 /**
31  * <p>
32  * Base class for data collectors that fill traces for static charts in one run.
33  * </p>
34  * <p>
35  * Extend from this class and override the method {@link #collectData()}.
36  * </p>
37  *
38  * @author <a HREF="mailto:Achim.Westermann@gmx.de">Achim Westermann </a>
39  *
40  * @version $Revision: 1.1 $
41  */

42 public abstract class AStaticDataCollector {
43
44   /**
45    * Target trace where all collected data is added.
46    */

47   protected ITrace2D m_trace;
48
49   /**
50    * Constructor with target trace.
51    * <p>
52    *
53    * @param trace
54    * the trace collected points will be added to.
55    */

56   public AStaticDataCollector(final ITrace2D trace) {
57     super();
58     this.m_trace = trace;
59   }
60
61   /**
62    * Collects all <code>ITracePoint</code> instances from it's underlying
63    * source and adds it to the internal trace.
64    * <p>
65    *
66    * @throws IOException
67    * if parsing or IO operations fails.
68    */

69   public abstract void collectData() throws IOException JavaDoc;
70
71   /**
72    * Returns the trace data is added to.
73    * <p>
74    *
75    * @return the trace data is added to.
76    */

77   public ITrace2D getTrace() {
78     return this.m_trace;
79   }
80 }
81
Popular Tags