![JAR search and dependency download from the Maven repository](/logo.png)
spoon.examples.bound.template.BoundTemplate Maven / Gradle / Ivy
The newest version!
package spoon.examples.bound.template;
import spoon.template.Parameter;
import spoon.template.Template;
public class BoundTemplate implements Template {
@Parameter
String _parameter_;
@Parameter
double _minBound_;
@Parameter
double _maxBound_;
public BoundTemplate(String parameterName,double minBound,double maxBound) {
_parameter_=parameterName;
_maxBound_=maxBound;
_minBound_=minBound;
}
public void test(Double _parameter_) throws Throwable {
if(_parameter_ > _maxBound_) {
throw new RuntimeException("out of max bound ("+_parameter_+">"+_maxBound_);
}
if(_parameter_ < _minBound_) {
throw new RuntimeException("out of min bound ("+_parameter_+"<"+_minBound_);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy