001: /*
002: * MCS Media Computer Software Copyright (c) 2005 by MCS
003: * -------------------------------------- Created on 23.04.2005 by w.klaas
004: *
005: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
006: * use this file except in compliance with the License. You may obtain a copy of
007: * the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
013: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
014: * License for the specific language governing permissions and limitations under
015: * the License.
016: */
017: package de.mcs.jmeasurement;
018:
019: /**
020: * This monitor is an dummy monitor which do nothing. No time measurement, no
021: * counting, nothing.
022: *
023: * @author w.klaas
024: */
025: public class NullMonitor implements Monitor {
026:
027: /**
028: * starting the measurement of this monitor.
029: *
030: * @return boolean <code>true</code> if the monitor could be startet,
031: * otherwise <code>false</code>
032: * @see de.mcs.jmeasurement.Monitor#start()
033: */
034: public final boolean start() {
035: return true;
036: }
037:
038: /**
039: * pausing the measurement.
040: *
041: * @return boolean <code>true</code> if the monitor could be paused,
042: * otherwise <code>false</code>
043: * @see de.mcs.jmeasurement.Monitor#pause()
044: */
045: public final boolean pause() {
046: return true;
047: }
048:
049: /**
050: * resume the measurement.
051: *
052: * @return boolean <code>true</code> if the monitor could be resumed,
053: * otherwise <code>false</code>
054: * @see de.mcs.jmeasurement.Monitor#resume()
055: */
056: public final boolean resume() {
057: return true;
058: }
059:
060: /**
061: * @param msec
062: * time to increase
063: * @see de.mcs.jmeasurement.Monitor#increase(long)
064: */
065: public void increase(final long msec) {
066: }
067:
068: /**
069: * @param msec
070: * time to decrease
071: * @see de.mcs.jmeasurement.Monitor#decrease(long)
072: */
073: public void decrease(final long msec) {
074: }
075:
076: /**
077: * stopping the measurment.
078: *
079: * @return boolean <code>true</code> if the monitor could be stopped,
080: * otherwise <code>false</code>
081: * @see de.mcs.jmeasurement.Monitor#stop()
082: */
083: public final boolean stop() {
084: return true;
085: }
086:
087: /**
088: * @return long getting the measured time.
089: * @see de.mcs.jmeasurement.Monitor#getAccrued()
090: */
091: public final long getAccrued() {
092: return 0;
093: }
094:
095: /**
096: * @see de.mcs.jmeasurement.Monitor#reset()
097: */
098: public void reset() {
099: }
100:
101: /**
102: * @return boolean the monitor is actual running
103: * @see de.mcs.jmeasurement.Monitor#isRunning()
104: */
105: public final boolean isRunning() {
106: return false;
107: }
108:
109: /**
110: * @return boolean the monitor is actual paused
111: * @see de.mcs.jmeasurement.Monitor#isPaused()
112: */
113: public final boolean isPaused() {
114: return false;
115: }
116:
117: /**
118: * @return the id of this monitor
119: * @see de.mcs.jmeasurement.Monitor#getMonitoId()
120: */
121: public final String getMonitoId() {
122: return "";
123: }
124:
125: /**
126: * @return this monitor has recorded an exception.
127: * @see de.mcs.jmeasurement.Monitor#hasException()
128: * @since 0.64
129: */
130: public final boolean hasException() {
131: return false;
132: }
133:
134: /**
135: * @return the text of the recorded exception or null.
136: * @see de.mcs.jmeasurement.Monitor#getException()
137: * @since 0.64
138: */
139: public final String getException() {
140: return null;
141: }
142:
143: /**
144: * setting a exception. This also stops the monitor, if it's running. The
145: * measuredata will not be accumulated.
146: *
147: * @param text
148: * the text for this exception.
149: * @see de.mcs.jmeasurement.Monitor#setException(String)
150: * @since 0.64
151: */
152: public final void setException(final String text) {
153: }
154:
155: /**
156: * setting a exception. This also stops the monitor, if it's running. The
157: * measuredata will not be accumulated.
158: *
159: * @param cause
160: * the exception to store.
161: * @see de.mcs.jmeasurement.Monitor#setException(Throwable)
162: * @since 0.66
163: */
164: public void setException(final Throwable cause) {
165: }
166: }
|