Class UpdateListener
java.lang.Object
de.uni_halle.informatik.biodata.mp.io.UpdateListener
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,org.sbml.jsbml.util.TreeNodeChangeListener
The
UpdateListener
class implements the TreeNodeChangeListener
to monitor and respond to changes
within an SBML model's structure. This class specifically handles updates to
identifiers (IDs) of model elements like reactions and gene products, ensuring that all references remain consistent
across the model. It also manages the addition of new nodes to the model, particularly focusing on gene product
references, and maintains a mapping from gene identifiers to their associated gene product references.
The TreeNodeChangeListener
base class provides the interface for receiving notifications when changes occur
to any node within a tree structure, which in the context of SBML, corresponds to elements within the model's
hierarchical structure.
-
Constructor Summary
ConstructorDescriptionConstructs anUpdateListener
instance and initializes thegeneIdToAssociation
map. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Handles the event when a new node is added to the TreeNode structure.void
nodeRemoved
(org.sbml.jsbml.util.TreeNodeRemovedEvent event) void
Responds to property change events, specifically focusing on changes to the ID property of tree nodes.
-
Constructor Details
-
UpdateListener
public UpdateListener()Constructs anUpdateListener
instance and initializes thegeneIdToAssociation
map.
-
-
Method Details
-
propertyChange
Responds to property change events, specifically focusing on changes to the ID property of tree nodes. This method handles the update of IDs within the model, ensuring that all references to the old ID are updated to the new ID across various components such as reactions and gene products.- Specified by:
propertyChange
in interfacePropertyChangeListener
- Parameters:
evt
- The property change event that contains information about the old and new values of the property.
-
nodeAdded
Handles the event when a new node is added to the TreeNode structure. Specifically, when a GeneProductRef node is added, this method updates the geneIdToAssociation map to include this new association. It ensures that each gene product ID is mapped to a set of its associated GeneProductRefs.- Specified by:
nodeAdded
in interfaceorg.sbml.jsbml.util.TreeNodeChangeListener
- Parameters:
node
- The TreeNode that has been added. Expected to be an instance of GeneProductRef.
-
nodeRemoved
public void nodeRemoved(org.sbml.jsbml.util.TreeNodeRemovedEvent event) - Specified by:
nodeRemoved
in interfaceorg.sbml.jsbml.util.TreeNodeChangeListener
-