org.sbml.jsbml
public abstract class AbstractSBase extends AbstractTreeNode implements SBase
SBase component.| Modifier and Type | Class and Description |
|---|---|
private static class |
AbstractSBase.NOTES_TYPE |
| Modifier and Type | Field and Description |
|---|---|
private Annotation |
annotation
Annotations of the SBML component.
|
private java.util.Map<java.lang.String,java.lang.String> |
declaredNamespaces
Contains all the namespaces declared on the XML node with their prefixes.
|
private java.lang.String |
elementNamespace
the namespace which this SBase element belong to.
|
private java.util.SortedMap<java.lang.String,SBasePlugin> |
extensions
Map containing the SBML extension object of additional packages
with the appropriate name space of the package. |
private static java.util.regex.Pattern |
idPattern
Pattern to recognize valid meta-identifier strings for SBML elements.
|
protected java.util.SortedMap<java.lang.String,XMLNode> |
ignoredExtensions
Map containing the ignored package objects. |
protected XMLNode |
ignoredXMLElements
Contains the unknown XML attributes or elements.
|
private static org.apache.log4j.Logger |
logger
A logger for this class.
|
(package private) ValuePair<java.lang.Integer,java.lang.Integer> |
lv
Level and version of the SBML component.
|
private java.lang.String |
metaId
metaid of the SBML component.
|
private XMLNode |
notesXMLNode
notes of the SBML component.
|
private int |
sboTerm
sbo term of the SBML component.
|
private static long |
serialVersionUID
Generated serial version identifier.
|
private static java.util.regex.Pattern |
simpleIdPattern
Pattern to recognize valid meta-identifier strings for SBML elements.
|
listOfListeners, parent, UNKNOWN_ATTRIBUTES, UNKNOWN_ELEMENTS| Constructor and Description |
|---|
AbstractSBase()
Creates an AbstractSBase instance.
|
AbstractSBase(int level,
int version)
Creates an
AbstractSBase instance with the given SBML Level and
Version. |
AbstractSBase(SBase sb)
Creates an
AbstractSBase instance from a given AbstractSBase. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCVTerm(CVTerm term)
Adds a
CVTerm. |
void |
addDeclaredNamespace(java.lang.String prefix,
java.lang.String namespace)
Adds an additional name space to the set of declared namespaces of this
SBase. |
void |
addExtension(java.lang.String nameOrUri,
SBasePlugin sbasePlugin)
Adds a
SBasePlugin extension object to this SBase. |
void |
addPlugin(java.lang.String nameOrUri,
SBasePlugin sbasePlugin)
Adds a
SBasePlugin extension object to this SBase. |
void |
appendNotes(java.lang.String notes)
Appends 'notes' to the notes String of this object.
|
void |
appendNotes(XMLNode notes)
Appends notes to the existing notes.
|
protected boolean |
checkLevelAndVersionCompatibility(SBase sbase)
Checks whether or not the given
SBase has the same level and
version configuration than this element. |
abstract AbstractSBase |
clone()
Creates a deep copy of this object, i.e., a new
SBase with the same properties
like this one. |
History |
createHistory()
Creates a new
History and associates it with the annotation of
this element. |
SBasePlugin |
createPlugin(java.lang.String nameOrUri)
Creates a new
SBasePlugin for the given package name or URI
and adds it to this SBase. |
void |
disablePackage(java.lang.String packageURIOrName)
Disables the given SBML Level 3 package on this
SBMLDocument. |
void |
enablePackage(java.lang.String packageURIOrName)
Enables the given SBML Level 3 package on this
SBMLDocument. |
void |
enablePackage(java.lang.String packageURIOrName,
boolean enabled)
Enables or disables the given SBML Level 3 package on this
SBMLDocument. |
boolean |
equals(java.lang.Object object)
|
java.util.List<CVTerm> |
filterCVTerms(CVTerm.Qualifier qualifier)
Returns a list of all the
CVTerm with the given CVTerm.Qualifier. |
java.util.List<java.lang.String> |
filterCVTerms(CVTerm.Qualifier qualifier,
boolean recursive,
java.lang.String... patterns)
Returns a list of resource URIs for the given
CVTerm.Qualifier that match the
given patterns. |
java.util.List<java.lang.String> |
filterCVTerms(CVTerm.Qualifier qualifier,
java.lang.String pattern)
Queries the list of controlled vocabulary terms (
CVTerm) for those terms whose
CVTerm.Qualifier is of the given type and selects only those resources from
these terms that contain the given pattern. |
java.util.List<java.lang.String> |
filterCVTerms(CVTerm.Qualifier qualifier,
java.lang.String pattern,
boolean recursive)
Returns a list of resource URIs for the given
CVTerm.Qualifier that match the
given pattern. |
void |
fireNodeRemovedEvent()
All
TreeNodeChangeListener instances linked to this
TreeNode are informed about the deletion of this TreeNode
from a parent Object. |
void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
All
TreeNodeChangeListeners are informed about the change in this
TreeNodeWithChangeSupport. |
boolean |
getAllowsChildren() |
Annotation |
getAnnotation()
Returns the content of the 'annotation' sub-element of this object as an
Annotation instance. |
java.lang.String |
getAnnotationString()
Returns the
Annotation of this SBML object as a String. |
javax.swing.tree.TreeNode |
getChildAt(int childIndex) |
int |
getChildCount() |
CVTerm |
getCVTerm(int index)
|
int |
getCVTermCount()
|
java.util.List<CVTerm> |
getCVTerms()
Returns the list of
CVTerms of this object. |
java.util.Map<java.lang.String,java.lang.String> |
getDeclaredNamespaces()
Returns all the namespaces declared on this object.
|
java.lang.String |
getElementName()
Returns the XML element name of this object.
|
SBasePlugin |
getExtension(java.lang.String nameOrUri)
Returns the
SBasePlugin extension object which matches this package name or URI. |
int |
getExtensionCount()
Returns the number of
SBasePlugins of this SBase. |
java.util.Map<java.lang.String,SBasePlugin> |
getExtensionPackages()
Returns the map containing all the
SBasePlugin extension objects
of this SBase. |
private int |
getFirstElementIndex(XMLNode curNotes)
Return the index of the first child of type 'Element' for the given
XMLNode. |
History |
getHistory()
Returns the
History instance of this object. |
protected IdManager |
getIdManager(SBase sbase)
|
int |
getLevel()
Returns the SBML Level of the overall SBML document.
|
ValuePair<java.lang.Integer,java.lang.Integer> |
getLevelAndVersion()
Returns the Level and Version combination of this
SBase. |
java.lang.String |
getMetaId()
Returns the metaid of this element.
|
Model |
getModel()
|
java.lang.String |
getNamespace()
Returns the namespace to which this
SBase belong to. |
XMLNode |
getNotes()
Returns an
XMLNode object that represent the notes of this element. |
java.lang.String |
getNotesString()
Returns the notes sub-element of this object as a
String. |
int |
getNumCVTerms()
|
int |
getNumPlugins()
Returns the number of
SBasePlugins of this SBase. |
SBase |
getParent()
This is equivalent to calling
getParentSBMLObject(), but this
method is needed for TreeNode. |
SBase |
getParentSBMLObject()
Returns the parent of this
SBase. |
SBasePlugin |
getPlugin(java.lang.String nameOrUri)
Returns an
SBasePlugin for an SBML Level 3 package extension
with the given package name or URI. |
SBMLDocument |
getSBMLDocument()
Returns the parent
SBMLDocument object. |
int |
getSBOTerm()
Grants access to the Systems Biology Ontology (SBO) term associated with
this
SBase. |
java.lang.String |
getSBOTermID()
Grants access to the Systems Biology Ontology (SBO) term associated with
this
SBase. |
int |
getVersion()
Returns the Version within the SBML Level of the overall SBML document.
|
int |
hashCode()
Returns a hash code value for this
SBase instance. |
boolean |
hasValidAnnotation()
Returns
true if the Annotation RDF 'about' attribute matches the metaid of this object. |
boolean |
hasValidLevelVersionNamespaceCombination()
Returns
true or false depending on whether this object's
level/version and namespace values correspond to a valid SBML
specification. |
boolean |
isExtendedByOtherPackages()
Returns
true if this object is extended by other packages. |
boolean |
isPackageEnabled(java.lang.String packageURIOrName)
Returns
true if the given SBML Level 3 package is enabled within the containing SBMLDocument. |
boolean |
isPackageURIEnabled(java.lang.String packageURIOrName)
Returns
true if the given SBML Level 3 package is enabled within the containing SBMLDocument. |
boolean |
isPkgEnabled(java.lang.String packageURIOrName)
Deprecated.
|
boolean |
isPkgURIEnabled(java.lang.String packageURIOrName)
Deprecated.
|
boolean |
isSetAnnotation()
Returns
true or false depending on whether this object's
'annotation' sub-elements exists and have some content. |
boolean |
isSetHistory()
Returns
true if the History instance of this object is set. |
boolean |
isSetLevel()
Returns
true if the level is set. |
boolean |
isSetLevelAndVersion()
Returns
true if both, Level and Version are set for this
SBase. |
boolean |
isSetMetaId()
Returns
true or false depending on whether this object's
'metaid' attribute has been set. |
boolean |
isSetNotes()
Returns
true or false depending on whether this object's
'notes' sub-element exists and has content. |
boolean |
isSetParentSBMLObject()
Check whether this
SBase has been linked to a parent within the
hierarchical SBML data structure. |
boolean |
isSetPlugin(java.lang.String nameOrUri)
Returns
true if an SBasePlugin is defined
for the given package. |
boolean |
isSetSBOTerm()
Returns
true if the SBOTerm is set. |
boolean |
isSetVersion()
Returns
true if the version is not null. |
static boolean |
isValidLevelAndVersionCombination(int level,
int version)
Returns
true if the level and version combination is a valid one, false otherwise. |
static boolean |
isValidMetaId(java.lang.String idCandidate)
Checks if the given identifier candidate satisfies the requirements for a
valid meta identifier (see SBML L2V4 p.
|
protected void |
notifyChildChange(javax.swing.tree.TreeNode oldChild,
javax.swing.tree.TreeNode newChild)
This method is called when one child has been swapped with another one
and can be used to check certain properties of the resulting changed
tree.
|
boolean |
readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value)
Sets the given attribute in this
SBase. |
void |
registerChild(SBase sbase)
Sets this object as SBML parent of 'sbase'.
|
private void |
registerChild(SBasePlugin sbasePlugin)
|
boolean |
removeCVTerm(CVTerm cvTerm)
Removes the given
CVTerm. |
CVTerm |
removeCVTerm(int index)
Removes the
CVTerm at the given index. |
void |
setAnnotation(Annotation annotation)
Sets the value of the 'annotation' sub-element of this SBML object to a
copy of annotation given as an
Annotation instance. |
void |
setHistory(History history)
Sets the history.
|
void |
setLevel(int level)
Sets the level of this object with 'level'.
|
(package private) boolean |
setLevelAndVersion(int level,
int version,
boolean strict)
Sets recursively the level and version attribute for this element
and all sub-elements.
|
void |
setMetaId(java.lang.String metaId)
Sets the metaid value with 'metaid'.
|
void |
setNamespace(java.lang.String namespace)
Sets the XML namespace to which this
SBase belong. |
void |
setNotes(java.lang.String notes)
Sets the notes with 'notes'.
|
void |
setNotes(XMLNode notes)
Sets the
XMLNode containing the notes sub-element of
this object. |
protected void |
setParentSBML(SBase parent) |
protected void |
setParentSBMLObject(SBase sbase)
Checks the Level/Version configuration of the new parent (if it is
compliant to the one of this
SBase), adds all changeListeners from
the parent to this SBase, fires a
TreeNodeChangeListener.nodeAdded(TreeNode) event, and and finally,
it will forward the new parent to setParentSBML(SBase). |
void |
setSBOTerm(int term)
Sets the value of the 'sboTerm' attribute.
|
void |
setSBOTerm(java.lang.String sboid)
Sets the value of the 'sboTerm' attribute.
|
void |
setThisAsParentSBMLObject(SBase sbase)
Deprecated.
|
void |
setVersion(int version)
Sets the version of this object with 'version'.
|
abstract java.lang.String |
toString() |
void |
unregisterChild(SBase sbase)
Unregisters recursively the given SBase from the
Model
and SBMLDocument. |
private void |
unregisterChild(SBasePlugin sbasePlugin)
|
void |
unsetAnnotation()
Unsets the value of the 'annotation' sub-element of this SBML object.
|
void |
unsetCVTerms()
Unsets the list of
CVTerm of this object. |
void |
unsetExtension(java.lang.String nameOrUri)
Unsets the
SBasePlugin extension object which matches this package name or URI. |
void |
unsetHistory()
Unsets the
History of this object. |
void |
unsetMetaId()
Unsets the value of the 'metaid' attribute of this SBML object.
|
void |
unsetNamespace()
Unsets the namespace that is associated to this
SBase. |
void |
unsetNotes()
Unsets the value of the 'notes' sub-element of this SBML object.
|
void |
unsetPlugin(java.lang.String nameOrUri)
Unsets the
SBasePlugin extension object which matches this package name or URI. |
void |
unsetSBOTerm()
Unsets the value of the 'sboTerm' attribute of this SBML object.
|
java.util.Map<java.lang.String,java.lang.String> |
writeXMLAttributes()
Returns a map with all the attributes of this
SBase that
need to be written out in XML. |
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isLeaf, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, setParent, userObjectKeySetfinalize, getClass, notify, notifyAll, wait, wait, waitremoveTreeNodeChangeListeneraddAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeUserObject, userObjectKeySetprivate static final java.util.regex.Pattern idPattern
private static final java.util.regex.Pattern simpleIdPattern
private static final org.apache.log4j.Logger logger
private static final long serialVersionUID
private Annotation annotation
private final java.util.Map<java.lang.String,java.lang.String> declaredNamespaces
private final java.util.SortedMap<java.lang.String,SBasePlugin> extensions
Map containing the SBML extension object of additional packages
with the appropriate name space of the package.protected java.util.SortedMap<java.lang.String,XMLNode> ignoredExtensions
Map containing the ignored package objects.
Package are considered ignored if JSBML does not support this package or support the package but not the associated namespace.
protected XMLNode ignoredXMLElements
ValuePair<java.lang.Integer,java.lang.Integer> lv
private java.lang.String metaId
private XMLNode notesXMLNode
private int sboTerm
private java.lang.String elementNamespace
public AbstractSBase()
By default, the sboTerm is -1, the
metaid, notes, parentSBMLObject, annotation, and
notes are null. The level and version are set to -1.
The setOfListeners list and the extensions hash map
are empty.
public AbstractSBase(int level,
int version)
AbstractSBase instance with the given SBML Level and
Version.
By default, the sboTerm is -1, the metaid, notes,
AbstractTreeNode.parent, annotation, and notes are null. The
declaredNamespaces list and the extensions Map are
empty.
level - the SBML levelversion - the SBML versionpublic AbstractSBase(SBase sb)
AbstractSBase instance from a given AbstractSBase.sb - an AbstractSBase object to clonepublic static boolean isValidLevelAndVersionCombination(int level,
int version)
true if the level and version combination is a valid one, false otherwise.level - the SBML levelversion - the SBML versiontrue if the level and version combination is a valid one, false otherwise.public static final boolean isValidMetaId(java.lang.String idCandidate)
idCandidate - true if the given argument is a valid meta identifier
String, false otherwise.public boolean addCVTerm(CVTerm term)
SBaseCVTerm.public void addDeclaredNamespace(java.lang.String prefix,
java.lang.String namespace)
SBase.addDeclaredNamespace in interface SBaseprefix - the prefix of the namespace to addnamespace - the namespace to addpublic void addExtension(java.lang.String nameOrUri,
SBasePlugin sbasePlugin)
SBaseSBasePlugin extension object to this SBase.
If a previous SBasePlugin associated with the same package
was present before, it will be replaced.
addExtension in interface SBasenameOrUri - the name or URI of the package extension.sbasePlugin - the SBasePlugin to add.public void addPlugin(java.lang.String nameOrUri,
SBasePlugin sbasePlugin)
SBaseSBasePlugin extension object to this SBase.
If a previous SBasePlugin associated with the same package
was present before, it will be replaced.
addPlugin in interface SBasenameOrUri - the name or URI of the package extension.sbasePlugin - the SBasePlugin to add.SBase.addExtension(String, SBasePlugin)public void setNamespace(java.lang.String namespace)
SBase belong.
This an internal method that should not be used outside of the main jsbml code (core + packages). One class should always belong to the same namespace, although the namespaces can have different level and version (and package version). You have to know what you are doing when using this method.
namespace - the XML namespace to which this SBase belong.public void appendNotes(java.lang.String notes)
throws javax.xml.stream.XMLStreamException
SBaseappendNotes in interface SBasenotes - the notes to be added.javax.xml.stream.XMLStreamException - if an error occurs while parsing the notes String.public void appendNotes(XMLNode notes)
This allows other notes to be preserved whilst adding additional information.
appendNotes in interface SBasenotes - protected boolean checkLevelAndVersionCompatibility(SBase sbase)
SBase has the same level and
version configuration than this element. If the L/V combination for the
given sbase is not yet defined, this method sets it to the
identical values as it is for the current object.sbase - the element to be checked.true if the given sbase and this object
have the same L/V configuration.LevelVersionError - In case the given SBase has a different, but defined
Level/Version combination than this current SBase, an
LevelVersionError is thrown. This method is only
package-wide visible because it is not intended to be a
"real" check, rather than to indicate potential errors.public abstract AbstractSBase clone()
SBaseSBase with the same properties
like this one.clone in interface SBaseclone in class AbstractTreeNodepublic History createHistory()
History and associates it with the annotation of
this element. If no Annotation exists, a new such element is
created as well.History instance that is directly associated with
this element.getHistory()public SBasePlugin createPlugin(java.lang.String nameOrUri)
SBaseSBasePlugin for the given package name or URI
and adds it to this SBase.
If an SBasePlugin was already present in this SBase
it will be replaced.
createPlugin in interface SBasenameOrUri - the package name or URISBasePlugin for the given package name or URIpublic void disablePackage(java.lang.String packageURIOrName)
SBMLDocument.disablePackage in interface SBasepackageURIOrName - a package namespace URI or package namepublic void enablePackage(java.lang.String packageURIOrName)
SBMLDocument.enablePackage in interface SBasepackageURIOrName - a package namespace URI or package namepublic void enablePackage(java.lang.String packageURIOrName,
boolean enabled)
SBMLDocument.enablePackage in interface SBasepackageURIOrName - a package namespace URI or package nameenabled - a boolean to tell if the package need to be enabled or disabled. It true
the package will be enabled, otherwise it will be disabled.public boolean equals(java.lang.Object object)
SBasepublic java.util.List<CVTerm> filterCVTerms(CVTerm.Qualifier qualifier)
SBaseCVTerm with the given CVTerm.Qualifier.filterCVTerms in interface SBasequalifier - CVTerm.Qualifier used to filter the CVTerms.CVTerm with the given CVTerm.Qualifier.public java.util.List<java.lang.String> filterCVTerms(CVTerm.Qualifier qualifier, java.lang.String pattern)
SBaseCVTerm) for those terms whose
CVTerm.Qualifier is of the given type and selects only those resources from
these terms that contain the given pattern.filterCVTerms in interface SBasequalifier - CVTerm.Qualifier used to filter the CVTerms.pattern - a regexp pattern, for instance, '.*kegg.*' or '.*chebi.*'.Patternpublic java.util.List<java.lang.String> filterCVTerms(CVTerm.Qualifier qualifier, java.lang.String pattern, boolean recursive)
SBaseCVTerm.Qualifier that match the
given pattern.
This is a recursive implementation of #filterCVTerms(Qualifier, String)
that considers all child elements of the current instance of SBase
as well.
filterCVTerms in interface SBasequalifier - CVTerm.Qualifier used to filter the CVTerms.pattern - a regexp pattern, for instance, '.*kegg.*' or '.*chebi.*'.recursive - decides whether or not to consider all child elements of this
SBase and collecting the matching CVTerms of
all children recursively. If this argument is false, the
behavior of the method will be equivalent to calling
#filterCVTerms(Qualifier, String).CVTerm.Qualifier that match the
given pattern.#filterCVTerms(Qualifier, String),
Patternpublic java.util.List<java.lang.String> filterCVTerms(CVTerm.Qualifier qualifier, boolean recursive, java.lang.String... patterns)
SBaseCVTerm.Qualifier that match the
given patterns.filterCVTerms in interface SBasequalifier - CVTerm.Qualifier used to filter the CVTerms.recursive - boolean used to decides whether or not to consider all child elements of this
SBase and collecting the matching CVTerms of
all children recursively.patterns - an arbitrary list of patterns to be matched to the resources of each
CVTerm.CVTerm.Qualifier that match the
given pattern.#filterCVTerms(Qualifier, String, boolean),
CVTerm.filterResources(String...)public void firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
TreeNodeWithChangeSupportTreeNodeChangeListeners are informed about the change in this
TreeNodeWithChangeSupport.firePropertyChange in interface TreeNodeWithChangeSupportfirePropertyChange in class AbstractTreeNodepropertyName - Tells the TreeNodeChangeListener the name of the
property whose value has been changed.oldValue - This is the value before the change.newValue - This gives the new value that is now the new value for the
given property..public void fireNodeRemovedEvent()
TreeNodeWithChangeSupportTreeNodeChangeListener instances linked to this
TreeNode are informed about the deletion of this TreeNode
from a parent Object.fireNodeRemovedEvent in interface TreeNodeWithChangeSupportfireNodeRemovedEvent in class AbstractTreeNodepublic boolean getAllowsChildren()
getAllowsChildren in interface javax.swing.tree.TreeNodepublic Annotation getAnnotation()
SBaseAnnotation instance.getAnnotation in interface SBaseAnnotation instance.public java.lang.String getAnnotationString()
throws javax.xml.stream.XMLStreamException
Annotation of this SBML object as a String.getAnnotationString in interface SBaseAnnotation of this SBML object as a String or
an empty String if there are no Annotation.javax.xml.stream.XMLStreamExceptionpublic javax.swing.tree.TreeNode getChildAt(int childIndex)
getChildAt in interface javax.swing.tree.TreeNodepublic int getChildCount()
getChildCount in interface javax.swing.tree.TreeNodepublic int getCVTermCount()
SBasegetCVTermCount in interface SBaseCVTerms of this SBase.public java.util.List<CVTerm> getCVTerms()
SBaseCVTerms of this object.getCVTerms in interface SBaseCVTerms of this object. If not yet set, this method
initializes the annotation and returns an empty list.public java.util.Map<java.lang.String,java.lang.String> getDeclaredNamespaces()
SBasegetDeclaredNamespaces in interface SBasepublic java.lang.String getElementName()
SBasegetElementName in interface SBasepublic SBasePlugin getExtension(java.lang.String nameOrUri)
SBaseSBasePlugin extension object which matches this package name or URI.getExtension in interface SBasenameOrUri - the package name or URISBasePlugin extension object which matches this package name or URI,
null is returned if nothing matching the name or URI is found.public int getExtensionCount()
SBaseSBasePlugins of this SBase.getExtensionCount in interface SBaseSBasePlugins of this SBase.public java.util.Map<java.lang.String,SBasePlugin> getExtensionPackages()
SBaseSBasePlugin extension objects
of this SBase.getExtensionPackages in interface SBaseSBasePlugin extension objects
of this SBase.private int getFirstElementIndex(XMLNode curNotes)
XMLNode.curNotes - XMLNode, -1 otherwise.public History getHistory()
SBaseHistory instance of this object.getHistory in interface SBaseHistory instance of this object.protected IdManager getIdManager(SBase sbase)
IdManager that can register the given SBase.
It means that the method IdManager.accept(SBase) returned true.
public int getLevel()
SBasegetLevel in interface SBaseSBase.getVersion()public ValuePair<java.lang.Integer,java.lang.Integer> getLevelAndVersion()
SBaseSBase.getLevelAndVersion in interface SBaseValuePair with the Level and Version of this
SBase. Note that the returned ValuePair is never
null, but if undeclared it may contain elements set to -1.public java.lang.String getMetaId()
SBasepublic java.lang.String getNamespace()
SBaseSBase belong to.getNamespace in interface SBaseSBase belong to.public XMLNode getNotes()
XMLNode object that represent the notes of this element.public java.lang.String getNotesString()
throws javax.xml.stream.XMLStreamException
SBaseString.
If no notes are set, an empty String will be returned.
getNotesString in interface SBaseString. If no
notes are set, an empty String will be returned.javax.xml.stream.XMLStreamException - if an error occurs while writing the XMLNode to a String.public int getNumCVTerms()
SBasegetNumCVTerms in interface SBaseCVTerms of this SBase.public int getNumPlugins()
SBaseSBasePlugins of this SBase.getNumPlugins in interface SBaseSBasePlugins of this SBase.public SBase getParent()
getParentSBMLObject(), but this
method is needed for TreeNode.getParent in interface javax.swing.tree.TreeNodegetParent in class AbstractTreeNodegetParentSBMLObject()public SBase getParentSBMLObject()
SBaseSBase.getParentSBMLObject in interface SBaseTreeNode.getParent()public SBasePlugin getPlugin(java.lang.String nameOrUri)
SBaseSBasePlugin for an SBML Level 3 package extension
with the given package name or URI.
If no SBasePlugin is found for this package, a new SBasePlugin
is created, added to this SBase and returned.
getPlugin in interface SBasenameOrUri - the name or URI of the packageSBasePlugin for an SBML Level 3 package extension
with the given package name or URI.public SBMLDocument getSBMLDocument()
SBaseSBMLDocument object.
LibSBML uses the class SBMLDocument as a top-level container for storing
SBML content and data associated with it (such as warnings and error
messages). An SBML model in libSBML is contained inside an SBMLDocument
object. SBMLDocument corresponds roughly to the class 'sbml' defined in the
SBML Level 2 specification, but it does not have a direct correspondence
in SBML Level 1. (But, it is created by libSBML no matter whether the
model is Level 1 or Level 2.)
This method allows the SBMLDocument for the current object to be
retrieved.getSBMLDocument in interface SBaseSBMLDocument object of this SBML object.public int getSBOTerm()
SBaseSBase.getSBOTerm in interface SBaseSBOpublic java.lang.String getSBOTermID()
SBaseSBase.getSBOTermID in interface SBaseSBOpublic int getVersion()
SBasegetVersion in interface SBaseSBase.getLevel()public int hashCode()
SBaseSBase instance.hashCode in interface SBasehashCode in class AbstractTreeNodeSBase instance.Object.hashCode()public boolean hasValidAnnotation()
SBasetrue if the Annotation RDF 'about' attribute matches the metaid of this object.hasValidAnnotation in interface SBasetrue if the Annotation 'about' String of this
object matches the metaid of this object.public boolean hasValidLevelVersionNamespaceCombination()
SBasetrue or false depending on whether this object's
level/version and namespace values correspond to a valid SBML
specification.hasValidLevelVersionNamespaceCombination in interface SBasetrue if this object's level, version and namespace values
correspond to a valid SBML specification.public boolean isExtendedByOtherPackages()
SBasetrue if this object is extended by other packages.isExtendedByOtherPackages in interface SBasetrue if this object is extended by other packages.public boolean isPackageEnabled(java.lang.String packageURIOrName)
SBasetrue if the given SBML Level 3 package is enabled within the containing SBMLDocument.isPackageEnabled in interface SBasepackageURIOrName - the name or URI of the package extension.true if the given SBML Level 3 package is enabled within the containing SBMLDocument, false otherwise.public boolean isPackageURIEnabled(java.lang.String packageURIOrName)
SBasetrue if the given SBML Level 3 package is enabled within the containing SBMLDocument.isPackageURIEnabled in interface SBasepackageURIOrName - the name or URI of the package extension.true if the given SBML Level 3 package is enabled within the containing SBMLDocument, false otherwise.@Deprecated public boolean isPkgEnabled(java.lang.String packageURIOrName)
SBasetrue if the given SBML Level 3 package is enabled within the containing SBMLDocument.isPkgEnabled in interface SBasepackageURIOrName - the name or URI of the package extension.true if the given SBML Level 3 package is enabled within the containing SBMLDocument, false otherwise.@Deprecated public boolean isPkgURIEnabled(java.lang.String packageURIOrName)
SBasetrue if the given SBML Level 3 package is enabled within the containing SBMLDocument.isPkgURIEnabled in interface SBasepackageURIOrName - the name or URI of the package extension.true if the given SBML Level 3 package is enabled within the containing SBMLDocument, false otherwise.public boolean isSetAnnotation()
SBasetrue or false depending on whether this object's
'annotation' sub-elements exists and have some content.isSetAnnotation in interface SBasetrue if the Annotation instance of this object is not
null and contains at least one CVTerm or one
String containing other annotations than RDF or a
History instance.public boolean isSetHistory()
SBasetrue if the History instance of this object is set.isSetHistory in interface SBasetrue if the History instance of this object is set.public boolean isSetLevel()
SBasetrue if the level is set.isSetLevel in interface SBasetrue if the level is set.public boolean isSetLevelAndVersion()
SBasetrue if both, Level and Version are set for this
SBase.isSetLevelAndVersion in interface SBasetrue if SBase.isSetLevel() and
SBase.isSetVersion().public boolean isSetMetaId()
SBasetrue or false depending on whether this object's
'metaid' attribute has been set.isSetMetaId in interface SBasetrue if the metaid is not null.public boolean isSetNotes()
SBasetrue or false depending on whether this object's
'notes' sub-element exists and has content.isSetNotes in interface SBasetrue if the notes String is not null.public boolean isSetParentSBMLObject()
SBaseSBase has been linked to a parent within the
hierarchical SBML data structure.isSetParentSBMLObject in interface SBasetrue if this SBase has a parent SBML object,
false otherwise.SBase.getParentSBMLObject()public boolean isSetPlugin(java.lang.String nameOrUri)
SBasetrue if an SBasePlugin is defined
for the given package.isSetPlugin in interface SBasenameOrUri - the package name or URItrue if an SBasePlugin is defined
for the given package.public boolean isSetSBOTerm()
SBasetrue if the SBOTerm is set.isSetSBOTerm in interface SBasetrue if the SBOTerm is set.SBOpublic boolean isSetVersion()
SBasetrue if the version is not null.isSetVersion in interface SBasetrue if the version is not null.protected void notifyChildChange(javax.swing.tree.TreeNode oldChild,
javax.swing.tree.TreeNode newChild)
AbstractTreeNodenotifyChildChange in class AbstractTreeNodeoldChild - the element that was a child of this node before the change.newChild - the new child whose new parent is this node.public boolean readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value)
SBaseSBase.
If the given attribute name is not recognized, nothing is done and
false is returned.
readAttribute in interface SBaseattributeName - localName of the XML attributeprefix - prefix of the XML attributevalue - value of the XML attributetrue if the attribute has been successfully read.public void registerChild(SBase sbase) throws LevelVersionError
SBaseException is
thrown.registerChild in interface SBasesbase - the SBase to be registered.LevelVersionError - In case the given SBase has a different, but defined
Level/Version combination than this current SBase, an
LevelVersionError is thrown.private void registerChild(SBasePlugin sbasePlugin)
sbasePlugin - the SBasePlugin to register.public boolean removeCVTerm(CVTerm cvTerm)
CVTerm.removeCVTerm in interface SBasecvTerm - the CVTerm to removeCVTerm was successfully removed.public CVTerm removeCVTerm(int index)
CVTerm at the given index.removeCVTerm in interface SBaseindex - the indexCVTerm.java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())public void setAnnotation(Annotation annotation)
SBaseAnnotation instance.setAnnotation in interface SBaseannotation - the annotation of this SBasepublic void setHistory(History history)
SBasesetHistory in interface SBasehistory - the history of this SBasepublic void setLevel(int level)
SBaseException is thrown.boolean setLevelAndVersion(int level,
int version,
boolean strict)
level - the SBML levelversion - the SBML versionstrict - a boolean to say if the method need to be strict or not (not used at the moment)true if the operation as been successful.public void setMetaId(java.lang.String metaId)
SBasepublic void setNotes(java.lang.String notes)
throws javax.xml.stream.XMLStreamException
SBasepublic void setNotes(XMLNode notes)
SBaseXMLNode containing the notes sub-element of
this object.protected void setParentSBML(SBase parent)
protected void setParentSBMLObject(SBase sbase) throws LevelVersionError
SBase), adds all changeListeners from
the parent to this SBase, fires a
TreeNodeChangeListener.nodeAdded(TreeNode) event, and and finally,
it will forward the new parent to setParentSBML(SBase).
Note that this will cause another event to be triggered:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)
with the old and the new parent.sbase - the new parent element.LevelVersionError - if the SBML Level and Version configuration of the new parent
differs from the one of this SBase.#setParentSBML(SBase)}public void setSBOTerm(int term)
SBase Beginning with SBML Level 2 Version 3, objects derived from SBase have
an optional attribute named 'sboTerm' for supporting the use of the
Systems Biology Ontology. In SBML proper, the data type of the
attribute is a string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a
seven digit integer number; JSBML simplifies the representation by
only storing the 'NNNNNNN' integer portion. Thus, in JSBML, the
'sboTerm' attribute on SBase has data type int, and SBO identifiers
are stored simply as integers.
SBO terms are a type of optional annotation, and each different class
of SBML object derived from SBase imposes its own requirements about
the values permitted for 'sboTerm'. Please consult the SBML
Level 2 Version 4 specification for more information about
the use of SBO and the 'sboTerm' attribute.
setSBOTerm in interface SBaseterm - the NNNNNNN integer portion of the SBO identifierSBOpublic void setSBOTerm(java.lang.String sboid)
SBase Beginning with SBML Level 2 Version 3, objects derived from SBase have
an optional attribute named 'sboTerm' for supporting the use of the
Systems Biology Ontology. In SBML proper, the data type of the
attribute is a string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a
seven digit integer number; JSBML simplifies the representation by
only storing the 'NNNNNNN' integer portion. Thus, in JSBML, the
'sboTerm' attribute on SBase has data type int, and SBO identifiers
are stored simply as integers.
SBO terms are a type of optional annotation, and each different class
of SBML object derived from SBase imposes its own requirements about
the values permitted for 'sboTerm'. Please consult the SBML
Level 2 Version 4 specification for more information about
the use of SBO and the 'sboTerm' attribute.
setSBOTerm in interface SBasesboid - the SBO identifier of the form 'SBO:NNNNNNN'SBO@Deprecated public void setThisAsParentSBMLObject(SBase sbase) throws LevelVersionError
SBaseException is
thrown.setThisAsParentSBMLObject in interface SBasesbase - the child SBaseLevelVersionErrorpublic void setVersion(int version)
SBaseException is thrown.setVersion in interface SBaseversion - the SBML versionpublic abstract java.lang.String toString()
toString in class AbstractTreeNodepublic void unregisterChild(SBase sbase)
SBaseModel
and SBMLDocument.unregisterChild in interface SBasesbase - the SBase to be unregistered.private void unregisterChild(SBasePlugin sbasePlugin)
sbasePlugin - the SBasePlugin to unregister.public void unsetAnnotation()
SBaseunsetAnnotation in interface SBasepublic void unsetCVTerms()
SBaseCVTerm of this object.unsetCVTerms in interface SBasepublic void unsetHistory()
SBaseHistory of this object.unsetHistory in interface SBasepublic void unsetMetaId()
SBaseunsetMetaId in interface SBasepublic void unsetNamespace()
SBase.
This is an internal method of JSBML that should be used with caution.
public void unsetNotes()
SBaseunsetNotes in interface SBasepublic void unsetExtension(java.lang.String nameOrUri)
SBaseSBasePlugin extension object which matches this package name or URI.unsetExtension in interface SBasenameOrUri - the package name or URIpublic void unsetPlugin(java.lang.String nameOrUri)
SBaseSBasePlugin extension object which matches this package name or URI.unsetPlugin in interface SBasenameOrUri - the package name or URIpublic void unsetSBOTerm()
SBaseunsetSBOTerm in interface SBasepublic java.util.Map<java.lang.String,java.lang.String> writeXMLAttributes()
SBaseSBase that
need to be written out in XML.
The attribute name is used as a key and the attribute value as value. If a prefix is needed for the attribute name, it need to be set directly in this map.
writeXMLAttributes in interface SBaseMap containing the XML attributes of this object.