org.sbml.jsbml.ext.comp
public class CompModelPlugin extends CompSBasePlugin implements IdManager
Modifier and Type | Field and Description |
---|---|
private ListOf<Port> |
listOfPorts |
private ListOf<Submodel> |
listOfSubmodels |
private static org.apache.log4j.Logger |
logger
A
Logger for this class. |
private java.util.Map<java.lang.String,Port> |
mapOfPorts
Maps between the
Port identifiers and themselves. |
private static long |
serialVersionUID
Generated serial version identifier.
|
listOfReplacedElements, replacedBy
extendedSBase, packageVersion
listOfListeners, parent, UNKNOWN_ATTRIBUTES, UNKNOWN_ELEMENTS
Constructor and Description |
---|
CompModelPlugin(CompModelPlugin obj)
Creates a new
CompModelPlugin instance that is a copy of the current CompModelPlugin . |
CompModelPlugin(Model model)
Creates a new
CompModelPlugin instance, associated with the given Model |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(SBase sbase)
|
boolean |
addPort(Port port)
Adds a new
Port to the listOfPorts. |
boolean |
addSubmodel(Submodel submodel)
Adds a new
Submodel to the listOfSubmodels. |
CompModelPlugin |
clone()
clones this class
|
Port |
createPort()
Creates a new Port element and adds it to the ListOfPorts list
|
Port |
createPort(java.lang.String id)
Creates a new
Port element and adds it to the ListOfPorts list |
Submodel |
createSubmodel()
Creates a new Submodel element and adds it to the ListOfSubmodels list
|
Submodel |
createSubmodel(java.lang.String id)
Creates a new
Submodel element and adds it to the ListOfSubmodels list |
private Port |
findPort(java.lang.String id)
|
boolean |
getAllowsChildren() |
javax.swing.tree.TreeNode |
getChildAt(int childIndex) |
int |
getChildCount() |
ListOf<Port> |
getListOfPorts()
Returns the listOfPorts.
|
ListOf<Submodel> |
getListOfSubmodels()
Returns the listOfSubmodels.
|
int |
getNumPorts()
Returns the number of
Port of this CompModelPlugin . |
int |
getNumSubmodels()
Returns the number of
Submodel of this CompModelPlugin . |
Port |
getPort(int index)
Returns the n-th
Port object in this CompModelPlugin . |
Port |
getPort(java.lang.String id)
Returns a
Port element that has the given 'id' within
this CompModelPlugin or null if no such element can be found. |
int |
getPortCount()
Returns the number of
Port objects in this CompModelPlugin . |
Submodel |
getSubmodel(int index)
Returns the n-th
Submodel object in this CompModelPlugin . |
Submodel |
getSubmodel(java.lang.String id)
Returns a
Submodel element that has the given 'id' within
this CompModelPlugin or null if no such element can be found. |
int |
getSubmodelCount()
Returns the number of
Submodel objects in this CompModelPlugin . |
boolean |
isSetListOfPorts()
Returns
true , if listOfPorts contains at least one element. |
boolean |
isSetListOfSubmodels()
Returns
true , if listOfSubmodels contains at least one element. |
boolean |
readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value)
Reads and sets the attribute if it is know from this
SBasePlugin . |
boolean |
register(SBase sbase)
|
void |
removePort(int i)
Removes an element from the listOfPorts at the given index.
|
boolean |
removePort(Port port)
Removes an element from the listOfPorts.
|
void |
removeSubmodel(int i)
Removes an element from the listOfSubmodels at the given index.
|
boolean |
removeSubmodel(java.lang.String id)
Removes an element from the listOfSubmodels.
|
boolean |
removeSubmodel(Submodel submodel)
Removes an element from the listOfSubmodels.
|
void |
setListOfPorts(ListOf<Port> listOfPorts)
Sets the optional
ListOf<Port> . |
void |
setListOfSubmodels(ListOf<Submodel> listOfSubmodels)
Sets the optional
ListOf<Submodel> . |
boolean |
unregister(SBase sbase)
|
boolean |
unsetListOfPorts()
Returns
true , if listOfPorts contain at least one element,
otherwise false |
boolean |
unsetListOfSubmodels()
Returns
true , if listOfSubmodels contain at least one element,
otherwise false |
java.util.Map<java.lang.String,java.lang.String> |
writeXMLAttributes()
Returns a
Map containing the XML attributes of this object. |
addReplacedElement, createReplacedBy, createReplacedElement, getElementNamespace, getListOfReplacedElements, getNumReplacedElements, getPackageName, getParent, getParentSBMLObject, getPrefix, getReplacedBy, getReplacedElement, getReplacedElement, getReplacedElementCount, getURI, initDefaults, isSetListOfReplacedElements, isSetReplacedBy, removeReplacedElement, removeReplacedElement, setListOfReplacedElements, setReplacedBy, toString, unsetListOfReplacedElements, unsetReplacedBy
equals, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getExtendedSBase, getLevel, getPackageVersion, getSBMLDocument, getVersion, hashCode, isSetExtendedSBase, removeFromParent, setExtendedSBase
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isLeaf, isRoot, isSetParent, isSetUserObjects, notifyChildChange, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, setParent, userObjectKeySet
finalize, getClass, notify, notifyAll, wait, wait, wait
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, userObjectKeySet
private static final long serialVersionUID
private static final transient org.apache.log4j.Logger logger
Logger
for this class.public CompModelPlugin(CompModelPlugin obj)
CompModelPlugin
instance that is a copy of the current CompModelPlugin
.obj
- the CompModelPlugin
to clone.public CompModelPlugin(Model model)
CompModelPlugin
instance, associated with the given Model
model
- public boolean addPort(Port port)
Port
to the listOfPorts.
The listOfPorts is initialized if necessary.
port
- the element to add to the listtrue
(as specified by Collection.add
)public boolean addSubmodel(Submodel submodel)
Submodel
to the listOfSubmodels.
The listOfSubmodels is initialized if necessary.
submodel
- the element to add to the listtrue
(as specified by Collection.add
)public CompModelPlugin clone()
CompSBasePlugin
clone
in interface SBasePlugin
clone
in class CompSBasePlugin
SBasePlugin
from this SBasePlugin
.public Port createPort()
public Port createPort(java.lang.String id)
Port
element and adds it to the ListOfPorts listPort
elementpublic Submodel createSubmodel()
public Submodel createSubmodel(java.lang.String id)
Submodel
element and adds it to the ListOfSubmodels listSubmodel
elementprivate Port findPort(java.lang.String id)
public boolean getAllowsChildren()
getAllowsChildren
in interface javax.swing.tree.TreeNode
getAllowsChildren
in class CompSBasePlugin
public javax.swing.tree.TreeNode getChildAt(int childIndex)
getChildAt
in interface javax.swing.tree.TreeNode
getChildAt
in class CompSBasePlugin
public int getChildCount()
getChildCount
in interface javax.swing.tree.TreeNode
getChildCount
in class CompSBasePlugin
public ListOf<Port> getListOfPorts()
public ListOf<Submodel> getListOfSubmodels()
public int getNumPorts()
Port
of this CompModelPlugin
.Port
of this CompModelPlugin
.public int getNumSubmodels()
Submodel
of this CompModelPlugin
.Submodel
of this CompModelPlugin
.public Port getPort(int index)
Port
object in this CompModelPlugin
.n
- an indexPort
with the given index if it exists.java.lang.IndexOutOfBoundsException
public Port getPort(java.lang.String id)
Port
element that has the given 'id' within
this CompModelPlugin
or null
if no such element can be found.id
- an id indicating a Port
element of the
CompModelPlugin
.Port
element of the CompModelPlugin
that has
the given 'id' as id or null
if no element with this
'id' can be found.public int getPortCount()
Port
objects in this CompModelPlugin
.Port
objects in this CompModelPlugin
.public Submodel getSubmodel(int index)
Submodel
object in this CompModelPlugin
.n
- an indexSubmodel
with the given index if it exists.java.lang.IndexOutOfBoundsException
public Submodel getSubmodel(java.lang.String id)
Submodel
element that has the given 'id' within
this CompModelPlugin
or null
if no such element can be found.id
- an id indicating a Submodel
element of the
CompModelPlugin
.Submodel
element of the CompModelPlugin
that has
the given 'id' as id or null
if no element with this
'id' can be found.public int getSubmodelCount()
Submodel
objects in this CompModelPlugin
.Submodel
objects in this CompModelPlugin
.public boolean isSetListOfPorts()
true
, if listOfPorts contains at least one element.true
, if listOfPorts contains at least one element,
otherwise false
public boolean isSetListOfSubmodels()
true
, if listOfSubmodels contains at least one element.true
, if listOfSubmodels contains at least one element,
otherwise false
public boolean readAttribute(java.lang.String attributeName, java.lang.String prefix, java.lang.String value)
SBasePlugin
SBasePlugin
.readAttribute
in interface SBasePlugin
readAttribute
in class CompSBasePlugin
attributeName
- localName of the XML attributeprefix
- prefix of the XML attributevalue
- value of the XML attributetrue
if the attribute has been successfully read.public void removePort(int i)
i
- the index where to remove the Port
java.lang.IndexOutOfBoundsException
- if the listOf is not set or
if the index is out of bound (index < 0 || index > list.size)public boolean removePort(Port port)
port
- the element to be removed from the listtrue
if the list contained the specified elementList.remove(Object)
public void removeSubmodel(int i)
i
- the index where to remove the Submodel
java.lang.IndexOutOfBoundsException
- if the listOf is not set or
if the index is out of bound (index < 0 || index > list.size)public boolean removeSubmodel(java.lang.String id)
id
- the id of the element to be removed from the listtrue
if the list contained the specified elementList.remove(Object)
public boolean removeSubmodel(Submodel submodel)
submodel
- the element to be removed from the listtrue
if the list contained the specified elementList.remove(Object)
public void setListOfPorts(ListOf<Port> listOfPorts)
ListOf<Port>
. If listOfPorts
was defined before and contains some elements, they are all unset.listOfPorts
- public void setListOfSubmodels(ListOf<Submodel> listOfSubmodels)
ListOf<Submodel>
. If listOfSubmodels
was defined before and contains some elements, they are all unset.listOfSubmodels
- public boolean unsetListOfPorts()
true
, if listOfPorts contain at least one element,
otherwise false
true
, if listOfPorts contain at least one element,
otherwise false
public boolean unsetListOfSubmodels()
true
, if listOfSubmodels contain at least one element,
otherwise false
true
, if listOfSubmodels contain at least one element,
otherwise false
public java.util.Map<java.lang.String,java.lang.String> writeXMLAttributes()
SBasePlugin
Map
containing the XML attributes of this object.writeXMLAttributes
in interface SBasePlugin
writeXMLAttributes
in class CompSBasePlugin
Map
containing the XML attributes of this object.public boolean unregister(SBase sbase)
IdManager
unregister
in interface IdManager
true
if this operation was successfully performed,
false
otherwise.