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, lv
listOfListeners, 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() |
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)
If the attribute is an id or name attribute, it will set the id or name
of this object with the value of the XML attribute ('value').
|
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() |
addCVTerm, addDeclaredNamespace, addExtension, appendNotes, appendNotes, checkLevelAndVersionCompatibility, clone, createHistory, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, fireNodeRemovedEvent, getAllowsChildren, getAnnotation, getAnnotationString, getChildAt, getChildCount, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementName, getExtension, getExtensionPackages, getHistory, 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, setAnnotation, setHistory, setLevel, setLevelAndVersion, setMetaId, setNamespace, setNotes, setNotes, setParentSBML, setParentSBMLObject, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregister, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNamespace, unsetNotes, unsetPlugin, unsetSBOTerm
addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, firePropertyChange, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isLeaf, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, setParent, userObjectKeySet
finalize, getClass, notify, notifyAll, wait, wait, wait
isIdMandatory
addCVTerm, addDeclaredNamespace, addExtension, appendNotes, appendNotes, clone, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementName, getExtension, 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, removeTreeNodeChangeListener, setAnnotation, setHistory, setLevel, setMetaId, setNotes, setNotes, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregister, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNotes, unsetPlugin, unsetSBOTerm
addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeUserObject, userObjectKeySet
private 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 AbstractNamedSBase
public AbstractNamedSBase(java.lang.String id, int level, int version)
id
- the id of this AbstractNamedSBase
level
- the SBML levelversion
- the SBML versionpublic AbstractNamedSBase(java.lang.String id, java.lang.String name, int level, int version)
id
- the id of this AbstractNamedSBase
name
- the name of this AbstractNamedSBase
level
- 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)
SBase
true
if and only if the given SBase
has exactly the same
properties like this SBase
instance.equals
in interface SBase
equals
in class AbstractSBase
true
if and only if the given Object
is an instance of
SBase
that has exactly the same properties like this
SBase instance.public java.lang.String getId()
getId
in interface NamedSBase
public java.lang.String getName()
getName
in interface NamedSBase
public int hashCode()
hashCode
in interface SBase
hashCode
in class AbstractSBase
Object.hashCode()
public boolean isSetId()
isSetId
in interface NamedSBase
true
if the id is not null
.public boolean isSetName()
isSetName
in interface NamedSBase
true
if the name is not null
.public boolean readAttribute(java.lang.String attributeName, java.lang.String prefix, java.lang.String value)
SBase
readAttribute
in interface SBase
readAttribute
in class AbstractSBase
attributeName
- localName of the XML attributeprefix
- prefix of the XML attributevalue
- value of the XML attributetrue
if the attribute has been successfully read.public void setId(java.lang.String id)
NamedSBase
setId
in interface NamedSBase
public void setName(java.lang.String name)
NamedSBase
setName
in interface NamedSBase
public java.lang.String toString()
toString
in class AbstractSBase
public void unsetId()
NamedSBase
null
.unsetId
in interface NamedSBase
public void unsetName()
NamedSBase
null
.unsetName
in interface NamedSBase
public java.util.Map<java.lang.String,java.lang.String> writeXMLAttributes()
writeXMLAttributes
in interface SBase
writeXMLAttributes
in class AbstractSBase
Map
containing the XML attributes of this object.