public abstract class AbstractSBase extends AbstractTreeNode implements SBase
SBase component.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
JSBML_WRONG_SBO_TERM |
| 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. |
AbstractSBase(java.lang.String id)
Creates an
AbstractSBase with the given identifier. |
AbstractSBase(java.lang.String id,
int level,
int version)
Creates an
AbstractSBase from an id, level and version. |
AbstractSBase(java.lang.String id,
java.lang.String name,
int level,
int version)
Creates an
AbstractSBase from an id, name, level and version. |
| 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 |
appendAnnotation(java.lang.String annotation)
Appends the given annotation to the 'annotation' subelement of this object.
|
void |
appendAnnotation(XMLNode annotation)
Appends the given annotation to the 'annotation' subelement of this object.
|
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.
|
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. |
static java.util.HashMap<java.lang.String,java.lang.String> |
getAllDeclaredNamespaces(SBase sb)
Returns a map of all the declared namespaces in the SBML tree, visible to the given
SBase. |
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.
|
SBase |
getElementByMetaId(java.lang.String id)
Returns the first child element found that has the given metaid.
|
SBase |
getElementBySId(java.lang.String id)
Returns the first child element found that has the given id.
|
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. |
static 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. |
java.lang.String |
getId()
Returns the id of the element if it is set, an empty string otherwise.
|
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 |
getName()
Returns the name of the element if it is set, an empty string otherwise.
|
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. |
java.lang.String |
getPackageName()
Returns the name of the SBML Level 3 package in which this element is defined, as
defined in the sbml.org community wiki.
|
int |
getPackageVersion()
Returns the version of the SBML Level 3 package to which this element belongs.
|
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. |
java.lang.String |
getURI()
Returns the namespace to which this
SBase belong to. |
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 |
isIdMandatory()
Returns
true if the identifier of this
SBase is required to be defined (i.e., not null)
in the definition of SBML. |
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 |
isSetId()
Returns
true if the id is not null. |
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 |
isSetName()
Returns
true if the name is not null. |
boolean |
isSetNotes()
Returns
true or false depending on whether this object's
'notes' sub-element exists and has content. |
boolean |
isSetPackageVErsion()
Returns
true if the package version is not equals to '-1'. |
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)
Deprecated.
|
boolean |
readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value)
Sets the given attribute in this
SBase. |
boolean |
registerChild(SBase sbase)
Sets this object as SBML parent of 'sbase'.
|
boolean |
removeCVTerm(CVTerm cvTerm)
Removes the given
CVTerm. |
CVTerm |
removeCVTerm(int index)
Removes the
CVTerm at the given index. |
void |
removeDeclaredNamespaceByNamespace(java.lang.String namespace)
Removes a namespace from the set of declared namespaces of this
SBase. |
void |
removeDeclaredNamespaceByPrefix(java.lang.String prefix)
Removes a namespace from the set of declared namespaces of this
SBase. |
boolean |
removeTopLevelAnnotationElement(java.lang.String name)
Removes the top-level element within the 'annotation' subelement of
this SBML object with the given name.
|
boolean |
removeTopLevelAnnotationElement(java.lang.String name,
java.lang.String elementURI)
Removes the top-level element within the 'annotation' subelement of
this SBML object with the given name and URI.
|
boolean |
removeTopLevelAnnotationElement(java.lang.String name,
java.lang.String elementURI,
boolean removeEmpty)
Removes the top-level element within the 'annotation' subelement of
this SBML object with the given name and URI.
|
boolean |
replaceTopLevelAnnotationElement(java.lang.String annotation)
Replaces the top-level element of this SBML object with same name as given
annotation subelement by the given one.
|
boolean |
replaceTopLevelAnnotationElement(XMLNode annotation)
Replaces the top-level element of this SBML object with same name as given
annotation subelement by the given one.
|
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 |
setAnnotation(java.lang.String nonRDFAnnotation)
Sets the non RDF part of the annotation.
|
void |
setAnnotation(XMLNode nonRDFAnnotation)
Sets the non RDF part of the annotation.
|
void |
setHistory(History history)
Sets the history.
|
void |
setId(java.lang.String id)
Sets the id value with 'id'
|
void |
setLevel(int level)
Sets the level of this object with 'level'.
|
void |
setMetaId(java.lang.String metaId)
Sets the metaid value with 'metaid'.
|
void |
setName(java.lang.String name)
Sets the name value with 'name'.
|
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. |
void |
setPackageVersion(int packageVersion)
Sets the version of the SBML Level 3 package to which this element belongs.
|
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'.
|
java.lang.String |
toString()
Returns a String representing this SBase with all the
attributes that are defined.
|
void |
unregisterChild(SBase sbase)
Unregisters recursively the given SBase from the
Model
and SBMLDocument. |
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 |
unsetId()
Sets the id value to
null. |
void |
unsetMetaId()
Unsets the value of the 'metaid' attribute of this SBML object.
|
void |
unsetName()
Sets the name value to
null. |
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, userObjectKeySetremoveTreeNodeChangeListeneraddAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeUserObject, userObjectKeySetpublic static final transient java.lang.String JSBML_WRONG_SBO_TERM
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 AbstractSBase(java.lang.String id)
AbstractSBase with the given identifier.
Note that with this constructor the level and version of the element are not specified. But when adding the SBase inside a Model, it will inherit the level and version from his parent.
id - the id of this AbstractSBasepublic AbstractSBase(java.lang.String id,
int level,
int version)
AbstractSBase from an id, level and version.id - the id of this AbstractSBaselevel - the SBML levelversion - the SBML versionpublic AbstractSBase(java.lang.String id,
java.lang.String name,
int level,
int version)
AbstractSBase from an id, name, level and version.id - the id of this AbstractSBasename - the name of this AbstractSBaselevel - the SBML levelversion - the SBML versionpublic 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.@Deprecated public static final boolean isValidMetaId(java.lang.String idCandidate)
SyntaxChecker.isValidMetaId(String)idCandidate - the id to checktrue 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 appendAnnotation(java.lang.String annotation)
throws javax.xml.stream.XMLStreamException
SBaseSBase.setAnnotation(XMLNode) or
SBase.setAnnotation(String), this method allows other
annotations to be preserved when an application adds its own data.appendAnnotation in interface SBaseannotation - an XML string that is to be copied and appended to the content of
the 'annotation' subelement of this objectjavax.xml.stream.XMLStreamException - thrown if the given annotation String cannot be parsed into
XMLNode objects.SBase.appendAnnotation(XMLNode)public void appendAnnotation(XMLNode annotation)
SBaseSBase.setAnnotation(XMLNode) or
SBase.setAnnotation(String), this method allows other
annotations to be preserved when an application adds its own data.appendAnnotation in interface SBaseannotation - an XML structure that is to be copied and appended to the content of
the 'annotation' subelement of this objectpublic 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 - the notes to append.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, 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 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 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 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 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.XMLStreamException - if there is a problem writing the annotation to XML.public 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 SBase getElementBySId(java.lang.String id)
SBaseThis operation searches the model-wide SId identifier type namespace.
So it will not find for example LocalParameter or UnitDefinition.
This method is here for compatibility with libSBML, it is less efficient than
the methods that are located in the Model and SBMLDocument classes.
If you want to get an SBase that is not in the SId namespace,
you can use the filter methods (for example: TreeNodeWithChangeSupport.filter(Filter))
using the IdFilter filter.
getElementBySId in interface SBaseid - string representing the id of the SBase to find.Model.getSBaseById(String)public SBase getElementByMetaId(java.lang.String id)
SBaseThis method is here for compatibility with libSBML, it is less efficient than
the methods that are located in the Model and SBMLDocument classes.
getElementByMetaId in interface SBaseid - string representing the metaid of the SBase to find.SBMLDocument.findSBase(String)public 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.public static int getFirstElementIndex(XMLNode curNotes)
XMLNode.curNotes - the XMLNodeXMLNode, -1 otherwise.public History getHistory()
SBaseHistory instance of this object.getHistory in interface SBaseHistory instance of this object.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 java.lang.String getPackageName()
SBaseFor example, the string "core" will be returned if this element is defined in SBML Level 3 Core.
getPackageName in interface SBasepublic int getPackageVersion()
SBaseThe value 0 will be returned if this element belongs to the SBML Level 3 Core package. The value -1 will be returned if this element does not belong to the SBML Level core and the value has not been set properly.
getPackageVersion in interface SBasepublic 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 java.lang.String getURI()
SBaseSBase belong to. Same as SBase.getNamespace().
For example, all elements that belong to Layout Extension Version 1 for SBML Level 3 Version 1 Core must have the URI 'http://www.sbml.org/sbml/level3/version1/layout/version1'.
The elements that belong to SBML core might return null.
getURI in interface SBaseSBase belong to.SBase.getNamespace()public 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 isIdMandatory()
SBasetrue if the identifier of this
SBase is required to be defined (i.e., not null)
in the definition of SBML.isIdMandatory in interface SBasetrue if the identifier of this element must be set in
order to create a valid SBML representation. false
otherwise, i.e., if the identifier can be understood as an optional
attribute.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 isSetPackageVErsion()
SBasetrue if the package version is not equals to '-1'.isSetPackageVErsion in interface SBasetrue if the package version is not equals to '-1'.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.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 boolean registerChild(SBase sbase) throws LevelVersionError
SBaseException is thrown.registerChild in interface SBasesbase - the SBase to be registered.true if the element could successfully be registered,
false otherwise, e.g., if the element has already been
registered.LevelVersionError - In case the given SBase has a different, but defined
Level/Version combination than this current SBase, an
LevelVersionError is thrown.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 removeDeclaredNamespaceByPrefix(java.lang.String prefix)
SBase.removeDeclaredNamespaceByPrefix in interface SBaseprefix - the prefix of the namespace to removepublic void removeDeclaredNamespaceByNamespace(java.lang.String namespace)
SBase.removeDeclaredNamespaceByNamespace in interface SBasenamespace - the namespace to removepublic boolean removeTopLevelAnnotationElement(java.lang.String name)
SBaseremoveTopLevelAnnotationElement in interface SBasename - of the annotation element to be removedpublic boolean removeTopLevelAnnotationElement(java.lang.String name,
java.lang.String elementURI)
SBaseremoveTopLevelAnnotationElement in interface SBasename - of the annotation element to be removedelementURI - of the annotation element to be removedpublic boolean removeTopLevelAnnotationElement(java.lang.String name,
java.lang.String elementURI,
boolean removeEmpty)
SBaseremoveTopLevelAnnotationElement in interface SBasename - of the annotation element to be removedelementURI - of the annotation element to be removed (if null, "" or "*", will match
any URI)removeEmpty - Whether to remove/unset the annotation, if it is
empty after removing the specified elementpublic boolean replaceTopLevelAnnotationElement(java.lang.String annotation)
throws javax.xml.stream.XMLStreamException,
java.lang.IllegalArgumentException
SBasereplaceTopLevelAnnotationElement in interface SBaseannotation - XML-string representing the annotation subelement to replace the
existing one of same namejavax.xml.stream.XMLStreamException - if the annotation-string cannot be parsed into an XMLjava.lang.IllegalArgumentException - if the annotation-string encodes more than
one annotation elementpublic boolean replaceTopLevelAnnotationElement(XMLNode annotation)
SBasereplaceTopLevelAnnotationElement in interface SBaseannotation - XMLNode representing the annotation subelement to replace the
existing one of same namepublic void setAnnotation(Annotation annotation)
SBaseAnnotation instance.setAnnotation in interface SBaseannotation - the annotation of this SBasepublic void setAnnotation(java.lang.String nonRDFAnnotation)
throws javax.xml.stream.XMLStreamException
SBasesetAnnotation in interface SBasenonRDFAnnotation - a String representing a piece of XML.javax.xml.stream.XMLStreamException - - if any problem occurs while reading the XML.public void setAnnotation(XMLNode nonRDFAnnotation)
SBasesetAnnotation in interface SBasenonRDFAnnotation - an XMLNodepublic void setHistory(History history)
SBasesetHistory in interface SBasehistory - the history of this SBasepublic void setLevel(int level)
SBaseException is thrown.public void setMetaId(java.lang.String metaId)
throws java.lang.IllegalArgumentException
SBasesetMetaId in interface SBasemetaId - the meatId to be set.java.lang.IllegalArgumentException - if the given metaid does not follow the pattern for valid metaids
ore if it is already used in the SBMLDocumentpublic 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 setNotes(java.lang.String notes)
throws javax.xml.stream.XMLStreamException
SBasepublic void setNotes(XMLNode notes)
SBaseXMLNode containing the notes sub-element of
this object.public void setPackageVersion(int packageVersion)
SBaseUse with caution, only if you know what you are doing. This should be set automatically.
setPackageVersion in interface SBasepackageVersion - the version of the SBML Level 3 package to which this element belongs.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 SBaseLevelVersionError - - if the parent and the child have a different level and version.public void setVersion(int version)
SBaseException is thrown.setVersion in interface SBaseversion - the SBML versionpublic java.lang.String toString()
toString in class AbstractTreeNodepublic void unregisterChild(SBase sbase)
SBaseModel
and SBMLDocument.unregisterChild in interface SBasesbase - the SBase to be unregistered.public void unsetAnnotation()
SBaseunsetAnnotation in interface SBasepublic void unsetCVTerms()
SBaseCVTerm of this object.unsetCVTerms 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 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 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.public java.lang.String getId()
SBasepublic java.lang.String getName()
SBasepublic boolean isSetId()
SBasetrue if the id is not null.public boolean isSetName()
SBasetrue if the name is not null.public void setId(java.lang.String id)
SBasepublic void setName(java.lang.String name)
SBasepublic void unsetId()
SBasenull.public void unsetName()
SBasenull.public static java.util.HashMap<java.lang.String,java.lang.String> getAllDeclaredNamespaces(SBase sb)
SBase.
Starting from the given SBase, we will use getDeclaredNamespaces() on it and all the parents until we
reached the SBMLDocument or these is no more parent set. That will give us a complete set of all the declared
namespace visible to this SBase. If a prefix if declared twice, we keep only the first occurrence encountered, meaning that
we will have the declaration that is the deeper in the tree, the one that is active for XML code.
sb - the SBaseSBase.