01: /*
02: * MCS Media Computer Software
03: * Copyright (c) 2005 by MCS
04: * --------------------------------------
05: * Created on 23.04.2005 by w.klaas
06: *
07: * Licensed under the Apache License, Version 2.0 (the "License");
08: * you may not use this file except in compliance with the License.
09: * You may obtain a copy of the License at
10: *
11: * http://www.apache.org/licenses/LICENSE-2.0
12: *
13: * Unless required by applicable law or agreed to in writing, software
14: * distributed under the License is distributed on an "AS IS" BASIS,
15: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16: * See the License for the specific language governing permissions and
17: * limitations under the License.
18: */
19: package de.mcs.jmeasurement.example;
20:
21: import de.mcs.jmeasurement.MeasureDataCallback;
22: import de.mcs.jmeasurement.MeasurePoint;
23: import de.mcs.jmeasurement.Monitor;
24:
25: /**
26: * This class is an example for a simple callback object. It will add 100 msec
27: * extra to every monitor, except the MeasurementPoint is called
28: * "de.mcs.jmeasurement.noadd".
29: * @author w.klaas
30: */
31: public class IncrementTime100 implements MeasureDataCallback {
32:
33: /**
34: * @see de.mcs.jmeasurement.MeasureDataCallback#setMonitor(de.mcs.jmeasurement.MeasurePoint,
35: * de.mcs.jmeasurement.Monitor)
36: * @param point the measurepoint, where the data will be added.
37: * @param monitor the monitor with the data to be added.
38: */
39: public final void setMonitor(final MeasurePoint point,
40: final Monitor monitor) {
41: if (!point.getName().equalsIgnoreCase(
42: "de.mcs.jmeasurement.noadd")) {
43: monitor.increase(100);
44: }
45: }
46:
47: }
|