All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.mcs.jmeasurement.example.IncrementTime100 Maven / Gradle / Ivy

There is a newer version: 1.1.226
Show newest version
/*
 * MCS Media Computer Software
 * Copyright (c) 2005 by MCS
 * --------------------------------------
 * Created on 23.04.2005 by w.klaas
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package de.mcs.jmeasurement.example;

import de.mcs.jmeasurement.MeasureDataCallback;
import de.mcs.jmeasurement.MeasurePoint;
import de.mcs.jmeasurement.Monitor;

/**
 * This class is an example for a simple callback object. It will add 100 msec
 * extra to every monitor, except the MeasurementPoint is called
 * "de.mcs.jmeasurement.noadd".
 * @author w.klaas
 */
public class IncrementTime100 implements MeasureDataCallback {

  /**
   * @see de.mcs.jmeasurement.MeasureDataCallback#setMonitor(de.mcs.jmeasurement.MeasurePoint,
   * de.mcs.jmeasurement.Monitor)
   * @param point the measurepoint, where the data will be added.
   * @param monitor the monitor with the data to be added.
   */
  public final void setMonitor(final MeasurePoint point, final Monitor monitor) {
    if (!point.getName().equalsIgnoreCase("de.mcs.jmeasurement.noadd")) {
      monitor.increase(100);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy