@@ -0,0 +1,1222 @@
+/*%0A * Copyright (c) 2012 Mateusz Parzonka, Eric Bodden%0A * All rights reserved. This program and the accompanying materials%0A * are made available under the terms of the Eclipse Public License v1.0%0A * which accompanies this distribution, and is available at%0A * http://www.eclipse.org/legal/epl-v10.html%0A *%0A * Contributors:%0A * Mateusz Parzonka - initial API and implementation%0A */%0Apackage prm4j.api;%0A%0Aimport prm4j.indexing.BaseMonitor;%0A%0Apublic abstract class Condition %7B%0A%0A    private transient BaseMonitor baseMonitor;%0A%0A    /**%0A     * Evaluate this condition based on the state of the base monitor and its attached parametric instance with%0A     * bindings.%0A     *%0A     * @param baseMonitor%0A     * @return%0A     */%0A    public boolean eval(BaseMonitor baseMonitor) %7B%0A%09this.baseMonitor = baseMonitor;%0A%09boolean result = false;%0A%09// protects from condition specification which try to access non-existing parameter values or similar%0A%09try %7B%0A%09    result = eval();%0A%09%7D finally %7B%0A%09%7D%0A%09this.baseMonitor = null;%0A%09return result;%0A    %7D%0A%0A    public %3CT%3E T getParameterValue(Parameter%3CT%3E parameter) %7B%0A%09return baseMonitor.getMetaNode().getParameterValue(parameter, baseMonitor.getLowLevelBindings());%0A    %7D%0A%0A    public abstract boolean eval();%0A%0A%7D%0A

Add Condition