Skip to content
Snippets Groups Projects
Commit 62c58a17 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

comparator of model includes functions, parameters, units

parent abd318d1
No related branches found
No related tags found
1 merge request!186Resolve "upload of sbml"
...@@ -6,7 +6,7 @@ import lcsb.mapviewer.common.comparator.StringComparator; ...@@ -6,7 +6,7 @@ import lcsb.mapviewer.common.comparator.StringComparator;
public class SbmlParameterComparator extends Comparator<SbmlParameter> { public class SbmlParameterComparator extends Comparator<SbmlParameter> {
protected SbmlParameterComparator() { public SbmlParameterComparator() {
super(SbmlParameter.class); super(SbmlParameter.class);
} }
......
...@@ -6,7 +6,7 @@ import lcsb.mapviewer.common.comparator.StringComparator; ...@@ -6,7 +6,7 @@ import lcsb.mapviewer.common.comparator.StringComparator;
public class SbmlUnitComparator extends Comparator<SbmlUnit> { public class SbmlUnitComparator extends Comparator<SbmlUnit> {
protected SbmlUnitComparator() { public SbmlUnitComparator() {
super(SbmlUnit.class); super(SbmlUnit.class);
} }
......
...@@ -12,8 +12,15 @@ import lcsb.mapviewer.common.Comparator; ...@@ -12,8 +12,15 @@ import lcsb.mapviewer.common.Comparator;
import lcsb.mapviewer.common.Configuration; import lcsb.mapviewer.common.Configuration;
import lcsb.mapviewer.common.comparator.DoubleComparator; import lcsb.mapviewer.common.comparator.DoubleComparator;
import lcsb.mapviewer.common.comparator.IntegerComparator; import lcsb.mapviewer.common.comparator.IntegerComparator;
import lcsb.mapviewer.common.comparator.SetComparator;
import lcsb.mapviewer.common.comparator.StringComparator; import lcsb.mapviewer.common.comparator.StringComparator;
import lcsb.mapviewer.model.map.graph.DataMiningSetComparator; import lcsb.mapviewer.model.map.graph.DataMiningSetComparator;
import lcsb.mapviewer.model.map.kinetics.SbmlFunction;
import lcsb.mapviewer.model.map.kinetics.SbmlFunctionComparator;
import lcsb.mapviewer.model.map.kinetics.SbmlParameter;
import lcsb.mapviewer.model.map.kinetics.SbmlParameterComparator;
import lcsb.mapviewer.model.map.kinetics.SbmlUnit;
import lcsb.mapviewer.model.map.kinetics.SbmlUnitComparator;
import lcsb.mapviewer.model.map.layout.Layout; import lcsb.mapviewer.model.map.layout.Layout;
import lcsb.mapviewer.model.map.layout.LayoutComparator; import lcsb.mapviewer.model.map.layout.LayoutComparator;
import lcsb.mapviewer.model.map.layout.graphics.Layer; import lcsb.mapviewer.model.map.layout.graphics.Layer;
...@@ -136,6 +143,24 @@ public class ModelComparator extends Comparator<Model> { ...@@ -136,6 +143,24 @@ public class ModelComparator extends Comparator<Model> {
logger.debug("Set of data mining sets different"); logger.debug("Set of data mining sets different");
return status; return status;
} }
SetComparator<SbmlUnit> unitSetComparator = new SetComparator<>(new SbmlUnitComparator());
status = unitSetComparator.compare(arg0.getUnits(), arg1.getUnits());
if (status != 0) {
logger.debug("units different");
return status;
}
SetComparator<SbmlFunction> functionSetComparator = new SetComparator<>(new SbmlFunctionComparator());
status = functionSetComparator.compare(arg0.getFunctions(), arg1.getFunctions());
if (status != 0) {
logger.debug("functions different");
return status;
}
SetComparator<SbmlParameter> parameterSetComparator = new SetComparator<>(new SbmlParameterComparator());
status = parameterSetComparator.compare(arg0.getParameters(), arg1.getParameters());
if (status != 0) {
logger.debug("parameters different");
return status;
}
DataMiningSetComparator dataMiningSetComparator = new DataMiningSetComparator(); DataMiningSetComparator dataMiningSetComparator = new DataMiningSetComparator();
for (int i = 0; i < arg0.getDataMiningSets().size(); i++) { for (int i = 0; i < arg0.getDataMiningSets().size(); i++) {
status = dataMiningSetComparator.compare(arg0.getDataMiningSets().get(i), arg1.getDataMiningSets().get(i)); status = dataMiningSetComparator.compare(arg0.getDataMiningSets().get(i), arg1.getDataMiningSets().get(i));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment