org.sbml.jsbml.ext.arrays.flattening
public class ArraysFlattening extends java.lang.Object
Constructor and Description |
---|
ArraysFlattening() |
Modifier and Type | Method and Description |
---|---|
private static void |
addToParent(Model model,
SBase parent,
SBase child)
Add the new SBase to the corresponding ListOf object.
|
private static void |
convert(Model model,
javax.swing.tree.TreeNode node,
java.util.List<SBase> sbases,
java.util.Map<java.lang.String,ASTNode> idToVector)
This is recursively getting each TreeNode of a certain SBMLDocument.
|
static SBMLDocument |
convert(SBMLDocument document)
This method flattens out arrays objects of a given
SBMLDocument . |
private static void |
convert(SBMLDocument doc,
Model model,
java.util.List<SBase> itemsToDelete,
java.util.Map<java.lang.String,ASTNode> idToVector) |
private static void |
convertArraysMath(Model model,
javax.swing.tree.TreeNode child,
java.util.Map<java.lang.String,ASTNode> idToVector) |
private static void |
convertEvent(Model model,
Event event,
java.util.List<SBase> itemsToDelete,
java.util.Map<java.lang.String,ASTNode> idToVector)
When an event is converted, the MathContainer objects (trigger, delay, and priority) are expanded.
|
private static void |
convertEvents(Model model,
java.util.List<SBase> itemsToDelete,
java.util.Map<java.lang.String,ASTNode> idToVector)
Iterate through the events in the model and convert the events using the arrays package.
|
private static void |
convertIndex(Model model,
ArraysSBasePlugin arraysPlugin,
SBase sbase,
ArraysCompiler compiler,
java.util.Map<java.lang.String,ASTNode> idToVector)
This is flattening index objects by replacing the dimension ids with the corresponding index value
and updating the referenced attribute.
|
private static void |
convertMath(Model model,
javax.swing.tree.TreeNode node,
java.util.Map<java.lang.String,ASTNode> idToVector)
This is recursively getting each TreeNode of a certain SBMLDocument and
flattening vector/selector MathML objects.
|
private static void |
convertMath(SBMLDocument doc,
Model model,
java.util.Map<java.lang.String,ASTNode> idToVector) |
private static void |
convertReaction(Model model,
Reaction reaction,
java.util.List<SBase> itemsToDelete,
java.util.Map<java.lang.String,ASTNode> idToVector) |
private static void |
convertReactions(Model model,
java.util.List<SBase> itemsToDelete,
java.util.Map<java.lang.String,ASTNode> idToVector) |
private static void |
expandDim(Model model,
SBase sbase,
SBase parent,
ArraysSBasePlugin arraysPlugin,
ArraysCompiler compiler,
ASTNode vector,
int dim,
java.util.Map<java.lang.String,ASTNode> idToVector)
This method is transforming the attributes of a certain SBase object associated with the arrays package
so that the SBase no longer uses the package.
|
private static void |
expandDim(Model model,
SBase sbase,
SBase parent,
ArraysSBasePlugin arraysPlugin,
ArraysCompiler compiler,
int dim,
java.util.Map<java.lang.String,ASTNode> idToVector)
This method is transforming the attributes of a certain SBase object associated with the arrays package
so that the SBase no longer uses the package.
|
private static void |
expandDim(Model model,
javax.swing.tree.TreeNode child,
java.util.List<SBase> sbases,
java.util.Map<java.lang.String,ASTNode> idToVector)
This expands an SBase that has a list of Dimension objects.
|
private static void |
expandEvent(Model model,
ArraysSBasePlugin arraysPlugin,
SBase parent,
Event event,
ASTNode vector,
int dim)
This method is inlining the event objects present in an array.
|
private static void |
expandReaction(Model model,
ArraysSBasePlugin arraysPlugin,
SBase parent,
Reaction reaction,
java.util.Map<java.lang.String,ASTNode> idToVector,
ASTNode vector,
int dim) |
private static void |
getVectors(SBase sbase,
java.util.Map<java.lang.String,ASTNode> ids) |
private static void |
recursiveReplaceDimensionId(ASTNode math,
java.lang.String id,
int index) |
private static void |
removeSBases(java.util.List<SBase> itemsToDelete)
This method removes a list of SBase from the respective parent.
|
private static ASTNode |
replaceDimensionId(ASTNode math,
java.lang.String id,
int index) |
private static void |
updateEventAssignmentIndex(Model model,
Event event,
Dimension dimension,
int index)
This updates the index math of the EventAssignments of a certain Event object that utlizes the
Dimension id of the parent Event.
|
private static void |
updateEventChildrenMetaId(Model model,
ArraysSBasePlugin arraysPlugin,
Event event,
int index) |
private static void |
updateIndexMath(SBase sbase,
Dimension dimension,
int index) |
private static void |
updateMathContainer(Model model,
ArraysSBasePlugin arraysPlugin,
MathContainer sbase,
java.lang.String dimId,
int index,
java.util.Map<java.lang.String,ASTNode> idToVector)
This updates the dimension id that appears in the math.
|
private static void |
updateReactionChildrenMetaId(Model model,
ArraysSBasePlugin arraysPlugin,
Reaction reaction,
int index) |
private static void |
updateSBase(SBMLDocument doc,
ArraysSBasePlugin arraysPlugin,
SBase sbase,
int index)
This updates the metaid of an SBase.
|
private static void |
updateSpecRefId(Model model,
ArraysSBasePlugin arraysPlugin,
Reaction reaction,
java.util.Map<java.lang.String,ASTNode> idToVector,
int index) |
private static void |
updateSpecRefIndex(Model model,
Reaction reaction,
Dimension dimension,
int index) |
private static final ASTNode unknown
public static SBMLDocument convert(SBMLDocument document)
SBMLDocument
.document
- - the document you want to convert.private static void removeSBases(java.util.List<SBase> itemsToDelete)
itemsToDelete
- private static void convertEvents(Model model, java.util.List<SBase> itemsToDelete, java.util.Map<java.lang.String,ASTNode> idToVector)
model
- idToIndices
- itemsToDelete
- private static void convertEvent(Model model, Event event, java.util.List<SBase> itemsToDelete, java.util.Map<java.lang.String,ASTNode> idToVector) throws SBMLException
model
- event
- itemsToDelete
- SBMLException
private static void expandEvent(Model model, ArraysSBasePlugin arraysPlugin, SBase parent, Event event, ASTNode vector, int dim)
model
- arraysPlugin
- parent
- event
- dim
- private static void updateEventAssignmentIndex(Model model, Event event, Dimension dimension, int index)
model
- event
- dimension
- index
- private static void convertReactions(Model model, java.util.List<SBase> itemsToDelete, java.util.Map<java.lang.String,ASTNode> idToVector)
model
- idToIndices
- itemsToDelete
- private static void convertReaction(Model model, Reaction reaction, java.util.List<SBase> itemsToDelete, java.util.Map<java.lang.String,ASTNode> idToVector) throws SBMLException
model
- reaction
- itemsToDelete
- SBMLException
private static void updateSpecRefId(Model model, ArraysSBasePlugin arraysPlugin, Reaction reaction, java.util.Map<java.lang.String,ASTNode> idToVector, int index)
arraysPlugin
- reaction
- index
- private static void updateReactionChildrenMetaId(Model model, ArraysSBasePlugin arraysPlugin, Reaction reaction, int index)
arraysPlugin
- reaction
- index
- private static void updateEventChildrenMetaId(Model model, ArraysSBasePlugin arraysPlugin, Event event, int index)
arraysPlugin
- reaction
- index
- private static void expandReaction(Model model, ArraysSBasePlugin arraysPlugin, SBase parent, Reaction reaction, java.util.Map<java.lang.String,ASTNode> idToVector, ASTNode vector, int dim)
model
- arraysPlugin
- parent
- reaction
- dim
- private static void updateSpecRefIndex(Model model, Reaction reaction, Dimension dimension, int index)
model
- reaction
- dimension
- index
- private static void updateIndexMath(SBase sbase, Dimension dimension, int index)
sbase
- dimension
- index
- private static void convert(SBMLDocument doc, Model model, java.util.List<SBase> itemsToDelete, java.util.Map<java.lang.String,ASTNode> idToVector)
model
- idToIndices
- itemsToDelete
- private static void convert(Model model, javax.swing.tree.TreeNode node, java.util.List<SBase> sbases, java.util.Map<java.lang.String,ASTNode> idToVector)
model
- node
- sbases
- private static void convertMath(SBMLDocument doc, Model model, java.util.Map<java.lang.String,ASTNode> idToVector)
model
- idToIndices
- itemsToDelete
- private static void convertMath(Model model, javax.swing.tree.TreeNode node, java.util.Map<java.lang.String,ASTNode> idToVector)
model
- node
- sbases
- private static void convertArraysMath(Model model, javax.swing.tree.TreeNode child, java.util.Map<java.lang.String,ASTNode> idToVector)
model
- child
- sbases
- private static void expandDim(Model model, javax.swing.tree.TreeNode child, java.util.List<SBase> sbases, java.util.Map<java.lang.String,ASTNode> idToVector)
model
- child
- sbases
- private static void expandDim(Model model, SBase sbase, SBase parent, ArraysSBasePlugin arraysPlugin, ArraysCompiler compiler, ASTNode vector, int dim, java.util.Map<java.lang.String,ASTNode> idToVector)
model
- sbase
- parent
- arraysPlugin
- compiler
- dim
- private static void expandDim(Model model, SBase sbase, SBase parent, ArraysSBasePlugin arraysPlugin, ArraysCompiler compiler, int dim, java.util.Map<java.lang.String,ASTNode> idToVector)
model
- sbase
- parent
- arraysPlugin
- compiler
- dim
- private static void addToParent(Model model, SBase parent, SBase child)
parent
- child
- private static void convertIndex(Model model, ArraysSBasePlugin arraysPlugin, SBase sbase, ArraysCompiler compiler, java.util.Map<java.lang.String,ASTNode> idToVector)
model
- arraysPlugin
- sbase
- compiler
- private static void updateMathContainer(Model model, ArraysSBasePlugin arraysPlugin, MathContainer sbase, java.lang.String dimId, int index, java.util.Map<java.lang.String,ASTNode> idToVector)
model
- arraysPlugin
- sbase
- dimId
- index
- ParseException
private static void updateSBase(SBMLDocument doc, ArraysSBasePlugin arraysPlugin, SBase sbase, int index)
arraysPlugin
- sbase
- index
- private static ASTNode replaceDimensionId(ASTNode math, java.lang.String id, int index)
private static void recursiveReplaceDimensionId(ASTNode math, java.lang.String id, int index)