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

de.mcs.jmeasurement.NullMonitor 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;

/**
 * This monitor is an dummy monitor which do nothing. No time measurement, no
 * counting, nothing.
 * 
 * @author w.klaas
 */
public class NullMonitor implements Monitor {

  /**
   * starting the measurement of this monitor.
   * 
   * @return boolean true if the monitor could be startet,
   *         otherwise false
   * @see de.mcs.jmeasurement.Monitor#start()
   */
  public final boolean start() {
    return true;
  }

  /**
   * pausing the measurement.
   * 
   * @return boolean true if the monitor could be paused,
   *         otherwise false
   * @see de.mcs.jmeasurement.Monitor#pause()
   */
  public final boolean pause() {
    return true;
  }

  /**
   * resume the measurement.
   * 
   * @return boolean true if the monitor could be resumed,
   *         otherwise false
   * @see de.mcs.jmeasurement.Monitor#resume()
   */
  public final boolean resume() {
    return true;
  }

  /**
   * @param msec
   *            time to increase
   * @see de.mcs.jmeasurement.Monitor#increase(long)
   */
  public void increase(final long msec) {
  }

  /**
   * @param msec
   *            time to decrease
   * @see de.mcs.jmeasurement.Monitor#decrease(long)
   */
  public void decrease(final long msec) {
  }

  /**
   * stopping the measurment.
   * 
   * @return boolean true if the monitor could be stopped,
   *         otherwise false
   * @see de.mcs.jmeasurement.Monitor#stop()
   */
  public final boolean stop() {
    return true;
  }

  /**
   * @return long getting the measured time.
   * @see de.mcs.jmeasurement.Monitor#getAccrued()
   */
  public final long getAccrued() {
    return 0;
  }

  /**
   * @see de.mcs.jmeasurement.Monitor#reset()
   */
  public void reset() {
  }

  /**
   * @return boolean the monitor is actual running
   * @see de.mcs.jmeasurement.Monitor#isRunning()
   */
  public final boolean isRunning() {
    return false;
  }

  /**
   * @return boolean the monitor is actual paused
   * @see de.mcs.jmeasurement.Monitor#isPaused()
   */
  public final boolean isPaused() {
    return false;
  }

  /**
   * @return the id of this monitor
   * @see de.mcs.jmeasurement.Monitor#getMonitoId()
   */
  public final String getMonitoId() {
    return "";
  }

  /**
   * @return this monitor has recorded an exception.
   * @see de.mcs.jmeasurement.Monitor#hasException()
   * @since 0.64
   */
  public final boolean hasException() {
    return false;
  }

  /**
   * @return the text of the recorded exception or null.
   * @see de.mcs.jmeasurement.Monitor#getException()
   * @since 0.64
   */
  public final String getException() {
    return null;
  }

  /**
   * setting a exception. This also stops the monitor, if it's running. The
   * measuredata will not be accumulated.
   * 
   * @param text
   *            the text for this exception.
   * @see de.mcs.jmeasurement.Monitor#setException(String)
   * @since 0.64
   */
  public final void setException(final String text) {
  }

  /**
   * setting a exception. This also stops the monitor, if it's running. The
   * measuredata will not be accumulated.
   * 
   * @param cause
   *            the exception to store.
   * @see de.mcs.jmeasurement.Monitor#setException(Throwable)
   * @since 0.66
   */
  public void setException(final Throwable cause) {
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy