org.sbml.jsbml
public abstract class AbstractNamedSBaseWithUnit extends AbstractNamedSBase implements NamedSBaseWithDerivedUnit, SBaseWithUnit
NamedSBaseWithDerivedUnit
and SBaseWithUnit
defines elements
that can be addressed by their identifier and are or can be associated with a
defined Unit
or UnitDefinition
. Derived elements from this
class might be directly or indirectly associated with some value, i.e., the
value might be derived by evaluating some expression in form of an
ASTNode
, or it might be directly defined as an attribute.Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID |
protected java.lang.String |
unitsID
The unit attribute of this variable.
|
ignoredExtensions, ignoredXMLElements, lv
listOfListeners, parent, UNKNOWN_ATTRIBUTES, UNKNOWN_ELEMENTS
Constructor and Description |
---|
AbstractNamedSBaseWithUnit()
Initializes a new object of type
AbstractNamedSBaseWithUnit whose
identifier and name are set to null and whose level and
version are set to -1 each. |
AbstractNamedSBaseWithUnit(AbstractNamedSBaseWithUnit nsbu) |
AbstractNamedSBaseWithUnit(int level,
int version) |
AbstractNamedSBaseWithUnit(java.lang.String id) |
AbstractNamedSBaseWithUnit(java.lang.String id,
int level,
int version) |
AbstractNamedSBaseWithUnit(java.lang.String id,
java.lang.String name,
int level,
int version) |
Modifier and Type | Method and Description |
---|---|
abstract AbstractNamedSBaseWithUnit |
clone()
Creates a deep copy of this object, i.e., a new
SBase with the same properties
like this one. |
boolean |
containsUndeclaredUnits()
Returns
true or false depending on whether this
SBaseWithDerivedUnit refers to elements such as parameters or
numbers with undeclared units. |
boolean |
equals(java.lang.Object object)
|
UnitDefinition |
getDerivedUnitDefinition()
This method derives the unit of this quantity and tries to identify an
equivalent
UnitDefinition within the corresponding Model . |
java.lang.String |
getDerivedUnits()
This method derives the unit of this quantity.
|
abstract java.lang.String |
getPredefinedUnitID()
Returns the predefined unit identifier for this data type with the
current level/version combination.
|
java.lang.String |
getUnits() |
UnitDefinition |
getUnitsInstance() |
int |
hashCode() |
boolean |
isPredefinedUnitsID(java.lang.String unitsID)
Checks whether or not a given identifier for a
Unit.Kind or
UnitDefinition equals a predefined unit identifier for this type. |
boolean |
isSetUnits() |
boolean |
isSetUnitsInstance()
Checks whether the element referenced by the
unitsID
attribute of this SBaseWithUnit is either an existing base
Unit , i.e., a simple Unit that can directly be addressed
via its Unit.Kind element, or the identifier of an existing
UnitDefinition in the Model to which this
SBaseWithUnit belongs. |
void |
setUnits(java.lang.String units)
Sets the unitsID of this
SBaseWithUnit . |
void |
setUnits(Unit.Kind unitKind)
Sets the unit of this
SBaseWithUnit . |
void |
setUnits(Unit unit)
Sets the
Unit of this SBaseWithUnit . |
void |
setUnits(UnitDefinition units)
Set the unit attribute of this
SBaseWithUnit to the given
unit definition. |
void |
unsetUnits()
Sets the unitsID of this
SBaseWithUnit to null . |
checkIdentifier, getId, getName, isSetId, isSetName, isValidId, readAttribute, setId, setName, toString, unsetId, unsetName, writeXMLAttributes
addCVTerm, addDeclaredNamespace, addExtension, appendNotes, appendNotes, checkLevelAndVersionCompatibility, 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
getId, getName, isIdMandatory, isSetId, isSetName, setId, setName, unsetId, unsetName
addCVTerm, addDeclaredNamespace, addExtension, appendNotes, appendNotes, 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, readAttribute, registerChild, removeTreeNodeChangeListener, setAnnotation, setHistory, setLevel, setMetaId, setNotes, setNotes, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregister, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNotes, unsetPlugin, unsetSBOTerm, writeXMLAttributes
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
protected java.lang.String unitsID
public AbstractNamedSBaseWithUnit()
AbstractNamedSBaseWithUnit
whose
identifier and name are set to null
and whose level and
version are set to -1 each.public AbstractNamedSBaseWithUnit(AbstractNamedSBaseWithUnit nsbu)
nsbu
- public AbstractNamedSBaseWithUnit(int level, int version)
level
- version
- public AbstractNamedSBaseWithUnit(java.lang.String id)
id
- public AbstractNamedSBaseWithUnit(java.lang.String id, int level, int version)
id
- level
- version
- public AbstractNamedSBaseWithUnit(java.lang.String id, java.lang.String name, int level, int version)
id
- name
- level
- version
- public abstract AbstractNamedSBaseWithUnit clone()
SBase
SBase
with the same properties
like this one.clone
in interface SBase
clone
in class AbstractSBase
public boolean containsUndeclaredUnits()
SBaseWithDerivedUnit
true
or false
depending on whether this
SBaseWithDerivedUnit
refers to elements such as parameters or
numbers with undeclared units.
A return value of true indicates that the UnitDefinition
returned by SBaseWithDerivedUnit.getDerivedUnitDefinition()
may not accurately
represent the units of the expression.containsUndeclaredUnits
in interface SBaseWithDerivedUnit
true
if the math expression of this SBaseWithDerivedUnit
includes parameters/numbers with undeclared units,
false
otherwise.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 AbstractNamedSBase
true
if and only if the given Object
is an instance of
SBase
that has exactly the same properties like this
SBase instance.public UnitDefinition getDerivedUnitDefinition()
SBaseWithDerivedUnit
UnitDefinition
within the corresponding Model
.
If no equivalent unit definition can be found, a new unit definition will
be created that is not part of the model but represents the unit of this
quantity. If it is not possible to derive a unit for this quantity, null
will be returned.getDerivedUnitDefinition
in interface SBaseWithDerivedUnit
public java.lang.String getDerivedUnits()
SBaseWithDerivedUnit
Unit.Kind
this
method will return the String
representation of this
Unit.Kind
.getDerivedUnits
in interface SBaseWithDerivedUnit
public abstract java.lang.String getPredefinedUnitID()
Model
. This can
be one of the predefined unit identifiers if there are any.public java.lang.String getUnits()
getUnits
in interface SBaseWithUnit
SBaseWithUnit
. The empty
String
if it is not set.public UnitDefinition getUnitsInstance()
getUnitsInstance
in interface SBaseWithUnit
#unitsID
of
this SBaseWithUnit
as id. Null if it doesn't
exist. In case that the unit of this SBaseWithUnit
represents a base Unit
, a new UnitDefinition
will
be created and returned by this method. This new
UnitDefinition
will only contain the one unit represented
by the unit identifier in this SBaseWithUnit
. Note
that the corresponding model will not contain this
UnitDefinition
. The identifier of this new
UnitDefinition
will be set to the same value as the name
of the base Unit
.public int hashCode()
hashCode
in interface SBase
hashCode
in class AbstractNamedSBase
Object.hashCode()
public boolean isPredefinedUnitsID(java.lang.String unitsID)
Unit.Kind
or
UnitDefinition
equals a predefined unit identifier for this type.unitsID
- the identifier to be checked.true
if the given identifier equals the unit definition
identifier that is predefined under the Level/Version combination
for this data type.public boolean isSetUnits()
isSetUnits
in interface SBaseWithUnit
true
if the unitsID of this element is not null
.public boolean isSetUnitsInstance()
SBaseWithUnit
unitsID
attribute of this SBaseWithUnit
is either an existing base
Unit
, i.e., a simple Unit
that can directly be addressed
via its Unit.Kind
element, or the identifier of an existing
UnitDefinition
in the Model
to which this
SBaseWithUnit
belongs.isSetUnitsInstance
in interface SBaseWithUnit
true
if either a UnitDefinition
, which has the
unitsID
of this SBaseWithUnit
, can be
found in the Model
to which this
SBaseWithUnit
belongs, or if this element's
unitsID
as a corresponding base Unit
for the
given Level/Version combination.public void setUnits(Unit.Kind unitKind)
SBaseWithUnit
SBaseWithUnit
.
A new unit will be created base on this kind.setUnits
in interface SBaseWithUnit
public void setUnits(java.lang.String units)
SBaseWithUnit
SBaseWithUnit
. Only valid unit
kind names or identifiers of already existing UnitDefinition
s are
allowed arguments of this function.setUnits
in interface SBaseWithUnit
units
- the identifier of an already existing UnitDefinition
or an Unit.Kind
identifier for the current
level/version combination of this unit. Passing a null value
to this method is equivalent to calling SBaseWithUnit.unsetUnits()
.public void setUnits(Unit unit)
SBaseWithUnit
Unit
of this SBaseWithUnit
.setUnits
in interface SBaseWithUnit
public void setUnits(UnitDefinition units)
SBaseWithUnit
SBaseWithUnit
to the given
unit definition.setUnits
in interface SBaseWithUnit
public void unsetUnits()
SBaseWithUnit
SBaseWithUnit
to null
.unsetUnits
in interface SBaseWithUnit