public RenameEntityCommand(SBase entity, String oldID, String newID, Model.SBML.Model model) { this.entity = entity; this.oldID = oldID; this.newID = newID; this.model = model; }
/// <summary> /// Add data to the ReferenceLeafNode /// </summary> /// <param name="text"> /// A <see cref="System.String"/> /// </param> /// <param name="model"> /// A <see cref="Model"/> /// </param> public void AddData(string text, Model model) { // Retrieve the object from the model SBase reference = (SBase)model.findObject(text); if (reference != null) { this.idReference = text; this.data = reference; } }
public AssignmentRule(SBase variable) { this.variable = variable; }
public EventAssignment(SBase variable) { this.variable = variable; }
/// <summary> /// Sets an object as having a duplicate ID to an object already in the model /// </summary> /// <param name="original"> /// A <see cref="SBase"/> /// </param> public void setHasADuplicateId(SBase original) { this.duplicate = true; this.original = original; }
/// <summary> /// Checks all ReferenceLeafNodes so that they point to their SBase object. /// Used to complete a MathTree generated from MathML after it has been parsed and /// more about the model is known (such as paramters). /// </summary> /// <param name="model"> /// A <see cref="Model"/> /// </param> public override void SetSBaseReferences(Model model) { if (this.idReference != null) { SBase reference = (SBase)model.findObject(this.idReference); if (reference != null) { this.data = reference; } } }
public RateRule(SBase variable) { this.variable = variable; }
/// <summary> /// Updates the ID of an SBML object in the model, for renaming of SBML objects /// </summary> /// <param name="entity"> /// A <see cref="SBase"/> /// </param> public void updateID(SBase entity) { // If we have an old ID implies it has actully been renamed // If the model already contains that ID // and if the new ID is different to the old one if (entity.getOldID()!=null && this.IdTable.ContainsKey(entity.getOldID()) && entity.ID!=entity.getOldID()) { if (this.IdTable.ContainsKey(entity.ID)) { throw new DuplicateSBMLObjectIdException(entity.ID); } else { this.IdTable.Remove(entity.getOldID()); this.IdTable.Add(entity.ID, entity); } } }
/// <summary> /// Used when a new ID is found in the SBML document to add it /// and its object reference to the global IdTable /// </summary> /// <param name="id">The id of the object</param> /// <param name="reference"> /// The SBase <see cref="SBase"/> object with the corresponding id. /// </param> public void AddId(string id, SBase reference) { // Need to make sure that we don't add a duplicate refernce but add with a slightly different id // and flag as a possible duplicate for pass at the end if (this.IdTable.ContainsKey(id)) { // Duplicate found // Get the original SBase original = this.IdTable[id]; original.duplicateCount++; // Modify duplicates id reference.ID = reference.ID+"_"+original.duplicateCount; // Set the original reference.setHasADuplicateId(original); // Add to the idtable this.IdTable.Add(reference.ID, reference); } else { this.IdTable.Add(id, reference); } }
public InitialAssignment(SBase variable, Hashtable attrs) { this.variable = variable; this.setId(attrs); }
public InitialAssignment(SBase variable) { this.variable = variable; }