/** * Returns the listOfDomainTypes. Creates it if it is not already existing. * * @return the listOfDomainTypes */ public ListOf<DomainType> getListOfDomainTypes() { if (!isSetListOfDomainTypes()) { listOfDomainTypes = new ListOf<DomainType>(); listOfDomainTypes.setPackageVersion(-1); // changing the ListOf package name from 'core' to 'spatial' listOfDomainTypes.setPackageName(null); listOfDomainTypes.setPackageName(SpatialConstants.shortLabel); listOfDomainTypes.setSBaseListType(ListOf.Type.other); registerChild(listOfDomainTypes); } return listOfDomainTypes; }
/** * Removes the {@link #listOfCompartments} from this {@link Model} and * notifies all registered instances of {@link TreeNodeChangeListener}. * * @return {@code true} if calling this method lead to a change in this * data structure. */ public boolean unsetListOfCompartments() { if (listOfCompartments != null) { ListOf<Compartment> oldListOfCompartments = listOfCompartments; listOfCompartments = null; oldListOfCompartments.fireNodeRemovedEvent(); return true; } return false; }
/** * * @return the number of products {@link SpeciesReference}. */ public int getProductCount() { return listOfProducts == null ? 0 : listOfProducts.size(); }
/** * * @return the listOfReactants of this Reaction. Is initialized here if not * yet set. */ public ListOf<SpeciesReference> getListOfReactants() { if (listOfReactants == null) { listOfReactants = ListOf.initListOf(this, new ListOf<SpeciesReference>(), ListOf.Type.listOfReactants); registerChild(listOfReactants); } return listOfReactants; }
/** * Creates a new {@link GroupsModelPlugin} instance cloned from the given parameter. * * @param groupModelPlugin the instance to clone */ public GroupsModelPlugin(GroupsModelPlugin groupModelPlugin) { super(groupModelPlugin); // We don't clone the pointer to the containing model. if (groupModelPlugin.listOfGroups != null) { setListOfGroups(groupModelPlugin.getListOfGroups().clone()); } }
/** * Adds a {@link FunctionDefinition} instance to the listOfFunctionDefinitions * of this {@link Model}. * * @param functionDefinition * @return {@code true} if the {@link #listOfFunctionDefinitions} was * changed as a result of this call. */ public boolean addFunctionDefinition(FunctionDefinition functionDefinition) { return getListOfFunctionDefinitions().add(functionDefinition); }
/** * Returns a specific Unit instance belonging to this UnitDefinition. * * @param i * an integer, the index of the Unit to be returned. * @return the ith Unit of this UnitDefinition */ public Unit getUnit(int i) { return getListOfUnits().get(i); }
/** * Returns the listOfAnalyticVolumes. Creates it if it is not already existing. * * @return the listOfAnalyticVolumes */ public ListOf<AnalyticVolume> getListOfAnalyticVolumes() { if (!isSetListOfAnalyticVolumes()) { listOfAnalyticVolumes = new ListOf<AnalyticVolume>(); listOfAnalyticVolumes.setNamespace(SpatialConstants.namespaceURI); listOfAnalyticVolumes.setSBaseListType(ListOf.Type.other); registerChild(listOfAnalyticVolumes); } return listOfAnalyticVolumes; }
/** * Returns {@code true}, if listOfDomains contains at least one element. * * @return {@code true}, if listOfDomains contains at least one element, * otherwise {@code false} */ public boolean isSetListOfDomains() { if ((listOfDomains == null) || listOfDomains.isEmpty()) { return false; } return true; }
/** * Removes the nth modifier species (ModifierSpeciesReference object) in the * list of modifiers in this Reaction and returns it. * * @param i * the index of the ModifierSpeciesReference object to remove. * @return the removed ModifierSpeciesReference object, or null if the given * index is out of range. */ public ModifierSpeciesReference removeModifier(int i) { return getListOfModifiers().remove(i); }
/** * Sets the listOfModifiers of this {@link Reaction}. Automatically sets the * parentSBML object of the list to this {@link Reaction} instance. * * @param listOfModifiers */ public void setListOfModifiers(ListOf<ModifierSpeciesReference> listOfModifiers) { unsetListOfModifiers(); this.listOfModifiers = listOfModifiers; if ((this.listOfModifiers != null) && (this.listOfModifiers.getSBaseListType() != ListOf.Type.listOfModifiers)) { this.listOfModifiers.setSBaseListType(ListOf.Type.listOfModifiers); } registerChild(this.listOfModifiers); }
@Override public boolean check(ValidationContext ctx, Transition t) { if ((t.isSetListOfInputs() && t.getListOfInputs().isEmpty()) || (t.isSetListOfOutputs() && t.getListOfOutputs().isEmpty())) { ValidationConstraint.logError(ctx, QUAL_20406, t, Integer.toString(t.getListOfInputs().size()), Integer.toString(t.getListOfOutputs().size())); return false; } return true; } };
/** * Sets the {@link Type} of this {@link ListOf} instance to the {@link Type} * defined by the given {@link Class}. * * @param type a class instance */ public void setSBaseListType(Class<T> type) { setSBaseListType(Type.valueOf(type)); }
@Override public ListOf<T> clone() { return new ListOf<T>(this); }
/** * @param analyticGeometry */ public AnalyticGeometry(AnalyticGeometry analyticGeometry) { super(analyticGeometry); if (analyticGeometry.isSetListOfAnalyticVolumes()) { setListOfAnalyticVolumes(analyticGeometry.getListOfAnalyticVolumes().clone()); } }
/** * Adds an {@link UnitDefinition} instance to the * {@link #listOfUnitDefinitions} of this {@link Model}. * * @param unitDefinition * @return {@code true} if the {@link #listOfUnitDefinitions} was changed * as a result of this call. */ public boolean addUnitDefinition(UnitDefinition unitDefinition) { return getListOfUnitDefinitions().add(unitDefinition); }
/** * * @param i * @return the ith reactant {@link SpeciesReference} of the listOfReactants. * Can be null if it doesn't exist. */ public SpeciesReference getReactant(int i) { return getListOfReactants().get(i); }
/** * Returns the listOfParametricObjects. Creates it if it is not already existing. * * @return the listOfParametricObjects */ public ListOf<ParametricObject> getListOfParametricObjects() { if (!isSetListOfParametricObjects()) { listOfParametricObjects = new ListOf<ParametricObject>(getLevel(), getVersion()); listOfParametricObjects.setNamespace(SpatialConstants.namespaceURI); listOfParametricObjects.setSBaseListType(ListOf.Type.other); registerChild(listOfParametricObjects); } return listOfParametricObjects; }
/** * Returns {@code true}, if listOfAnalyticVolumes contains at least one element. * * @return {@code true}, if listOfAnalyticVolumes contains at least one element, * otherwise {@code false} */ public boolean isSetListOfAnalyticVolumes() { if ((listOfAnalyticVolumes == null) || listOfAnalyticVolumes.isEmpty()) { return false; } return true; }
/** * Removes the nth reactant species (SpeciesReference object) in the list of * reactants in this Reaction and returns it. * * @param i * the index of the SpeciesReference object to remove. * @return the removed SpeciesReference object, or null if the given index * is out of range. */ public SpeciesReference removeReactant(int i) { return getListOfReactants().remove(i); }