use of org.vcell.model.rbm.ComponentStateDefinition in project vcell by virtualcell.
the class XmlReader method getRbmMolecularComponent.
private MolecularComponent getRbmMolecularComponent(Element e, Model newModel) {
String s = e.getAttributeValue(XMLTags.NameAttrTag);
if (s == null || s.isEmpty()) {
System.out.println("XMLReader: getRbmMolecularComponent: name is missing.");
return null;
}
MolecularComponent mc = new MolecularComponent(s);
s = e.getAttributeValue(XMLTags.RbmIndexAttrTag);
if (s == null || s.isEmpty()) {
System.out.println("XMLReader: getRbmMolecularComponent: index is missing.");
return null;
}
int index = Integer.parseInt(s);
mc.setIndex(index);
List<Element> children = e.getChildren(XMLTags.RbmMolecularTypeAllowableStateTag, vcNamespace);
for (Element element : children) {
ComponentStateDefinition cs = getRbmComponentStateDefinition(element, newModel);
if (cs != null) {
mc.addComponentStateDefinition(cs);
}
}
return mc;
}
Aggregations