de.uni_hildesheim.sse.monitoring.runtime.annotations.TimerPosition Maven / Gradle / Ivy
package de.uni_hildesheim.sse.monitoring.runtime.annotations;
import de.uni_hildesheim.sse.codeEraser.annotations.Variability;
import de.uni_hildesheim.sse.monitoring.runtime.AnnotationConstants;
/**
* Defines the position where to affect instrumented code for
* {@link Timer}.
*
* @author Holger Eichelberger
* @since 1.00
* @version 1.00
*/
@Variability(id = AnnotationConstants.MONITOR_TIMERS)
public enum TimerPosition {
/**
* Use the default position.
*/
DEFAULT(false, false),
/**
* Override the default and force to beginning of a method / constructor.
*/
BEGINNING(true, false),
/**
* Override the default and force to end of a method / constructor.
*/
END(false, true),
/**
* Override the default and force to beginning and end of a
* method / constructor.
*/
BOTH(true, true);
/**
* Stores if this constant marks the beginning.
*/
private boolean beginning;
/**
* Stores if this constant marks the end.
*/
private boolean end;
/**
* Creates a new timer position.
*
* @param beginning true
if it marks the beginning,
* false
else
* @param end true
if it marks the end,
* false
else
*
* @since 1.00
*/
private TimerPosition(boolean beginning, boolean end) {
this.beginning = beginning;
this.end = end;
}
/**
* Returns if this constant marks the beginning.
*
* @return true
if it marks the beginning, false
* else
*/
public boolean isBeginning() {
return beginning;
}
/**
* Returns if this constant marks the end.
*
* @return true
if it marks the end, false
* else
*/
public boolean isEnd() {
return end;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy