org.sbml.jsbml
public abstract class AbstractNamedSBase extends AbstractSBase implements NamedSBase
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
digit |
private java.lang.String |
id
id of the SBML component (can be optional depending on the level and
version).
|
private static java.lang.String |
idChar |
private static java.lang.String |
letter |
private java.lang.String |
name
name of the SBML component (can be optional depending on the level and
version).
|
private static long |
serialVersionUID
Generated serial version identifier.
|
private static java.lang.String |
SIdL2 |
private static java.util.regex.Pattern |
SIdL2Pattern
Pattern to recognize valid SIds, i.e., identifier strings for SBML elements.
|
private static java.lang.String |
underscore |
ignoredExtensions, ignoredXMLElements, lvlistOfListeners, parent, UNKNOWN_ATTRIBUTES, UNKNOWN_ELEMENTS| Constructor and Description |
|---|
AbstractNamedSBase()
Creates an
AbstractNamedSBase. |
AbstractNamedSBase(AbstractNamedSBase nsb)
Creates an
AbstractNamedSBase from a given AbstractNamedSBase. |
AbstractNamedSBase(int level,
int version)
Creates an
AbstractNamedSBase from a level and version. |
AbstractNamedSBase(java.lang.String id)
Creates an
AbstractNamedSBase with the given identifier. |
AbstractNamedSBase(java.lang.String id,
int level,
int version)
Creates an AbctractNamedSBase from an id, level and version.
|
AbstractNamedSBase(java.lang.String id,
java.lang.String name,
int level,
int version)
Creates an AbctractNamedSBase from an id, name, level and version.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) boolean |
checkIdentifier(java.lang.String sID)
Checks if the sID is a valid identifier.
|
boolean |
equals(java.lang.Object object)
|
java.lang.String |
getId() |
java.lang.String |
getName() |
int |
hashCode()
Returns a hash code value for this
SBase instance. |
boolean |
isSetId() |
boolean |
isSetName() |
static boolean |
isValidId(java.lang.String idCandidate,
int level,
int version)
Checks whether the given idCandidate is a valid identifier according to
the SBML specifications.
|
boolean |
readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value)
Sets the given attribute in this
SBase. |
void |
setId(java.lang.String id)
sets the id value with 'id'
|
void |
setName(java.lang.String name)
sets the name value with 'name'.
|
java.lang.String |
toString()
Returns the name of the component, if it is available.
|
void |
unsetId()
sets the id value to
null. |
void |
unsetName()
sets the name value to
null. |
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. |
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendNotes, appendNotes, checkLevelAndVersionCompatibility, clone, createHistory, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, fireNodeRemovedEvent, firePropertyChange, getAllowsChildren, getAnnotation, getAnnotationString, getChildAt, getChildCount, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementName, getExtension, getExtensionCount, getExtensionPackages, getHistory, getIdManager, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getParent, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getVersion, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, isValidLevelAndVersionCombination, isValidMetaId, notifyChildChange, registerChild, removeCVTerm, removeCVTerm, setAnnotation, setHistory, setLevel, setLevelAndVersion, setMetaId, setNamespace, setNotes, setNotes, setParentSBML, setParentSBMLObject, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNamespace, unsetNotes, unsetPlugin, unsetSBOTermaddAllChangeListeners, 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, waitisIdMandatoryaddCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendNotes, appendNotes, clone, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementName, getExtension, getExtensionCount, getExtensionPackages, getHistory, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getVersion, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, registerChild, removeCVTerm, removeCVTerm, removeTreeNodeChangeListener, setAnnotation, setHistory, setLevel, setMetaId, setNotes, setNotes, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNotes, unsetPlugin, unsetSBOTermaddAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeUserObject, userObjectKeySetprivate static final long serialVersionUID
private static final java.lang.String underscore
private static final java.lang.String letter
private static final java.lang.String digit
private static final java.lang.String idChar
private static final java.lang.String SIdL2
private static final java.util.regex.Pattern SIdL2Pattern
private java.lang.String id
private java.lang.String name
public AbstractNamedSBase()
AbstractNamedSBase. By default, id and name are null.public AbstractNamedSBase(AbstractNamedSBase nsb)
AbstractNamedSBase from a given AbstractNamedSBase.nsb - an AbstractNamedSBase object to clonepublic AbstractNamedSBase(int level,
int version)
AbstractNamedSBase from a level and version. By default, id
and name are null.level - the SBML levelversion - the SBML versionpublic AbstractNamedSBase(java.lang.String id)
AbstractNamedSBase with the given identifier. Note
that with this constructor the level and version of the element are not
specified. These elements are however required to ensure the validity of
the SBML data structure. Without level and version, it may not be
possible to serialize this class to SBML.id - the id of this AbstractNamedSBasepublic AbstractNamedSBase(java.lang.String id,
int level,
int version)
id - the id of this AbstractNamedSBaselevel - the SBML levelversion - the SBML versionpublic AbstractNamedSBase(java.lang.String id,
java.lang.String name,
int level,
int version)
id - the id of this AbstractNamedSBasename - the name of this AbstractNamedSBaselevel - the SBML levelversion - the SBML versionpublic static final boolean isValidId(java.lang.String idCandidate,
int level,
int version)
idCandidate - The String to be tested.level - Level of the SBML to be used.version - Version of the SBML to be used.boolean checkIdentifier(java.lang.String sID)
sID - the identifier to be checked. If null or an invalid
identifier, an exception will be thrown.true only if the sID is a valid identifier.
Otherwise this method throws an IllegalArgumentException.
This is an intended behavior.java.lang.IllegalArgumentException - if the given id is not valid in this model.public boolean equals(java.lang.Object object)
SBasepublic java.lang.String getId()
getId in interface NamedSBasepublic java.lang.String getName()
getName in interface NamedSBasepublic int hashCode()
SBaseSBase instance.hashCode in interface SBasehashCode in class AbstractSBaseSBase instance.Object.hashCode()public boolean isSetId()
isSetId in interface NamedSBasetrue if the id is not null.public boolean isSetName()
isSetName in interface NamedSBasetrue if the name 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 SBasereadAttribute in class AbstractSBaseattributeName - localName of the XML attributeprefix - prefix of the XML attributevalue - value of the XML attributetrue if the attribute has been successfully read.public void setId(java.lang.String id)
NamedSBasesetId in interface NamedSBasepublic void setName(java.lang.String name)
NamedSBasesetName in interface NamedSBasepublic java.lang.String toString()
toString in class AbstractSBasepublic void unsetId()
NamedSBasenull.unsetId in interface NamedSBasepublic void unsetName()
NamedSBasenull.unsetName in interface NamedSBasepublic 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 SBasewriteXMLAttributes in class AbstractSBaseMap containing the XML attributes of this object.