Commit ad7bb857 authored by Nico Mack's avatar Nico Mack

removed redundant atomicUpdate method from EquationSystemBuilder class

parent 9b2d834a
......@@ -22,8 +22,6 @@ package lu.list.itis.dkd.tui.cps.system;
import lu.list.itis.dkd.dbc.annotation.NonNullByDefault;
import lu.list.itis.dkd.tui.bootstrapping.CpsConnectorBootstrapper;
import lu.list.itis.dkd.tui.cps.InputChangeListener;
import lu.list.itis.dkd.tui.cps.InputEvent;
import lu.list.itis.dkd.tui.cps.Phenomenon;
import lu.list.itis.dkd.tui.cps.system.connector.Connector;
import lu.list.itis.dkd.tui.cps.system.executor.Executor;
......@@ -35,7 +33,6 @@ import lu.list.itis.dkd.tui.utility.Point;
import lu.list.itis.dkd.tui.utility.StringUtils;
import com.google.common.base.Strings;
import com.jgoodies.common.base.Preconditions;
import org.jdom2.Document;
import org.jdom2.Element;
......@@ -857,27 +854,6 @@ public class EquationSystemBuilder {
// ***************************************************************************
// * Class Body *
// ***************************************************************************
// ---------------------------------------------------------------------------
public void atomicUpdate(List<Variable<?>> variables, List<Object> values) {
Preconditions.checkArgument(!variables.isEmpty(), "No variables to update!");
Preconditions.checkArgument(variables.size() == values.size(), "Sizes of variables and values lists must match!");
HashMap<InputChangeListener, List<Variable<?>>> consolidated = new HashMap<>();
for (int i = 0; i < variables.size(); i++) {
Variable<?> variable = variables.get(i);
variable.suspendListenerNotification(true);
variable.setValueFromObject(values.get(i));
variable.suspendListenerNotification(false);
consolidated = variable.consolidateListeners(consolidated);
}
for (Entry<InputChangeListener, List<Variable<?>>> entry : consolidated.entrySet()) {
entry.getKey().inputChanged(new InputEvent(entry.getValue()));
}
}
// ---------------------------------------------------------------------------
/**
* Method used to parse the file containing the XML representation of the equation system.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment