/** * Adds a Compartment instance to the listOfCompartments of this Model. * * @param compartment * @return {@code true} if the {@link #listOfCompartments} was changed as * a result of this call. */ public boolean addCompartment(Compartment compartment) { return getListOfCompartments().add(compartment); }
/** * Gets the n<sup>th</sup> {@link Compartment} instance of the * listOfCompartments. * * @param n the index of the element to return * @return the n<sup>th</sup> {@link Compartment} instance of the * listOfCompartments. * {@code null} if the listOfCompartments is not set. */ public Compartment getCompartment(int n) { return getListOfCompartments().get(n); }
/** * Removes the i-th {@link Compartment} of the {@link Model}. * * @param i * the index of the {@link Compartment} to remove * @return the removed {@link Compartment}. */ public Compartment removeCompartment(int i) { return getListOfCompartments().remove(i); }
for (Compartment compartment : model.getListOfCompartments()) {
@Override public boolean check(ValidationContext ctx, Model m) { if (m.isSetListOfCompartments() || m.isListOfCompartmentsEmpty()) { return new UnknownElementValidationFunction<TreeNodeWithChangeSupport>().check(ctx, m.getListOfCompartments()); } return true; } };
@Override public boolean check(ValidationContext ctx, Model m) { if (m.isSetListOfCompartments() || m.isListOfCompartmentsEmpty()) { return new UnknownAttributeValidationFunction<TreeNodeWithChangeSupport>().check(ctx, m.getListOfCompartments()); } return true; } };
for (Compartment c : model.getListOfCompartments()) { if ((model.getLevel()==1) || !(c.isConstant())) { variable = new InnerNode<SBase>(c);
ListOf<Compartment> compartments = model.getListOfCompartments(); for (int i = 0; i < compartments.size(); i++) { Compartment compartment = compartments.get(i);
ListOf<Compartment> compartments = model.getListOfCompartments(); for (int i = 0; i < compartments.size(); i++) {
private Model flattenModel(Model modelOfSubmodel) { flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfReactions()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfCompartments()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfConstraints()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfEvents()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfFunctionDefinitions()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfParameters()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfRules()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfSpecies()); flattenSBaseList(modelOfSubmodel, modelOfSubmodel.getListOfUnitDefinitions()); return modelOfSubmodel; }
mergedModel.setVersion(previousModel.getVersion()); mergeListsOfModels(previousModel.getListOfCompartments(), previousModel, mergedModel); mergeListsOfModels(previousModel.getListOfSpecies(), previousModel, mergedModel); mergeListsOfModels(previousModel.getListOfFunctionDefinitions(), previousModel, mergedModel); mergeListsOfModels(currentModel.getListOfCompartments(), currentModel, mergedModel); mergeListsOfModels(currentModel.getListOfSpecies(), currentModel, mergedModel); mergeListsOfModels(currentModel.getListOfFunctionDefinitions(), currentModel, mergedModel);
ListOf<Compartment> compartmentListOf = sourceModel.getListOfCompartments().clone(); sourceModel.getListOfCompartments().removeFromParent();
setListOfCompartments(model.getListOfCompartments().clone());