public class UnitDefinition extends AbstractNamedSBase
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AREA
Identifier of the (for SBML Level 2) predefined
UnitDefinition
area . |
static java.lang.String |
BASE_UNIT_SUFFIX
The suffix used in
UnitDefinition objects that represent a base
Unit.Kind with offset = 0, multiplier = 1, scale = 0, and exponent
= 1. |
static java.lang.String |
EXTENT
Identifier of the (for SBML Level 3)
UnitDefinition
extent . |
static java.lang.String |
LENGTH
Identifier of the (for SBML Level 2) predefined
UnitDefinition
length . |
private ListOf<Unit> |
listOfUnits
Represents the 'listOfUnit' XML sub-element of a UnitDefinition.
|
private static org.apache.log4j.Logger |
logger
The logger for this class.
|
static long |
serialVersionUID
Generated serial version identifier.
|
static java.lang.String |
SUBSTANCE
Identifier of the (for the SBML Levels 1 and 2) predefined
UnitDefinition substance . |
static java.lang.String |
TIME
Identifier of the (for the SBML Levels 1 and 2) predefined
UnitDefinition time . |
static java.lang.String |
VOLUME
Identifier of the (for some SBML Levels 1 and 2) predefined
UnitDefinition volume . |
ignoredExtensions, ignoredXMLElements, JSBML_WRONG_SBO_TERM, lv, packageName
listOfListeners, parent, resourceBundle
Constructor and Description |
---|
UnitDefinition()
Creates an UnitDefinition instance.
|
UnitDefinition(int level,
int version)
Creates a new
UnitDefinition instance. |
UnitDefinition(java.lang.String id)
Creates a new
UnitDefinition instance. |
UnitDefinition(java.lang.String id,
int level,
int version)
Creates an
UnitDefinition instance from an id, level and version. |
UnitDefinition(java.lang.String id,
java.lang.String name,
int level,
int version)
Creates an
UnitDefinition instance from an id, level and version. |
UnitDefinition(UnitDefinition unitDefinition)
Creates an
UnitDefinition instance from a given UnitDefinition. |
Modifier and Type | Method and Description |
---|---|
void |
addUnit(java.lang.String unit)
|
void |
addUnit(Unit.Kind kind)
Adds a new
Unit instance, with the given kind, to this UnitDefinition . |
void |
addUnit(Unit u)
Adds a
Unit to this UnitDefinition . |
static UnitDefinition |
area(int level,
int version)
Returns the predefined unit for area.
|
static boolean |
areCompatible(UnitDefinition ud1,
UnitDefinition ud2)
Returns
true or false depending on
whether two UnitDefinition objects are compatible. |
static boolean |
areEquivalent(UnitDefinition ud,
java.lang.String units)
Checks whether the given
UnitDefinition and the
UnitDefinition or Unit represented by the given
String are equivalent. |
static boolean |
areEquivalent(UnitDefinition ud1,
UnitDefinition ud2)
Returns true or false depending on whether two
UnitDefinition objects are equivalent. |
static boolean |
areIdentical(UnitDefinition ud1,
UnitDefinition ud2)
|
void |
clear()
Removes all
Unit elements from the list of Units in this object. |
UnitDefinition |
clone()
Creates a deep copy of this object, i.e., a new
SBase with the same
properties
like this one. |
void |
convertToSIUnits()
This method converts this unit definition to a
|
Unit |
createInvalidUnit()
|
Unit |
createUnit()
|
Unit |
createUnit(Unit.Kind kind)
|
UnitDefinition |
divideBy(UnitDefinition definition)
Divides this unit definition by the second unit definition.
|
boolean |
getAllowsChildren() |
javax.swing.tree.TreeNode |
getChildAt(int index) |
int |
getChildCount() |
ListOf<Unit> |
getListOfUnits() |
int |
getNumUnits() |
ListOf<UnitDefinition> |
getParent()
This is equivalent to calling
AbstractSBase.getParentSBMLObject() , but this
method is needed for TreeNode . |
static UnitDefinition |
getPredefinedUnit(java.lang.String id,
int level,
int version)
Returns the predefined unit with the given identifier for the
specified level and version combination or null if either for the given
combination of level and version there is no such predefined unit or the
identifier is not one of those belonging to the group of predefined unit
definitions.
|
Unit |
getUnit(int i)
Returns a specific Unit instance belonging to this UnitDefinition.
|
int |
getUnitCount() |
boolean |
isBuiltIn()
Deprecated.
use
isPredefined() |
static boolean |
isBuiltIn(UnitDefinition ud)
Deprecated.
use
isPredefined() |
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 |
isInvalid()
Checks if this UnitDefinition is invalid.
|
boolean |
isListOfUnitsEmpty()
Returns
true if the listOfUnits is empty. |
boolean |
isPredefined()
Tests if this unit definition is a predefined unit.
|
static boolean |
isPredefined(java.lang.String name,
int level)
Tests if the given String is a predefined unit, meaning it is one of the five SBML predefined
unit identifiers ('substance', 'volume', 'area', 'length' or 'time').
|
static boolean |
isPredefined(UnitDefinition ud)
Tests if the given unit is a predefined unit, meaning it is one of the five SBML predefined
unit identifiers ('substance', 'volume', 'area', 'length' or 'time').
|
boolean |
isSetListOfUnits()
Returns
true if the listOfUnits is not null and not empty. |
boolean |
isUnitKind()
Tests whether this
UnitDefinition contains
exactly one Unit that itself represents a Unit.Kind , i.e.,
multiplier = 1, exponent = 1, scale = 1. |
boolean |
isVariantOfArea()
Returns
true if this UnitDefinition is a variant of Area |
boolean |
isVariantOfDimensionless()
Tests if a given unit definition is a variant
of the predefined unit identifier 'dimensionless'.
|
boolean |
isVariantOfLength()
Tests if a given unit definition is a variant
of the predefined unit identifier 'length'.
|
boolean |
isVariantOfSubstance()
Tests if a given unit definition is a variant
of the predefined unit identifier 'substance'.
|
boolean |
isVariantOfSubstancePerArea()
Tests if a given unit definition is a variant
of the predefined unit identifier 'substance per area'.
|
boolean |
isVariantOfSubstancePerLength()
Tests if this UnitDefinition is a variant of substance per
length.
|
boolean |
isVariantOfSubstancePerTime()
Tests if this UnitDefinition is a variant of substance per
time.
|
boolean |
isVariantOfSubstancePerVolume()
Tests if this UnitDefinition is a variant of substance per volume.
|
boolean |
isVariantOfTime()
Tests if a given unit definition is a variant
of the predefined unit identifier 'time'.
|
boolean |
isVariantOfVolume()
Tests if a given unit definition is a variant
of the predefined unit identifier 'volume'.
|
static UnitDefinition |
length(int level,
int version)
Returns the predefined unit for length.
|
UnitDefinition |
multiplyWith(UnitDefinition definition)
Multiplies this unit with the given unit definition, i.e., adds a clone
of each unit object in the list of units of the given definition to the
list of this unit.
|
static java.lang.String |
printUnits(UnitDefinition ud)
Returns a string that expresses the unit definition represented by this
UnitDefinition object.
|
static java.lang.String |
printUnits(UnitDefinition ud,
boolean compact)
Returns a string that expresses the unit definition represented by this
UnitDefinition object.
|
UnitDefinition |
raiseByThePowerOf(double exponent)
Raises this unit definition by the power of the given exponent, i.e., the
exponents of every unit contained by this unit definition are multiplied
with the given exponent.
|
Unit |
removeUnit(int i)
Removes the nth
Unit object from this UnitDefinition object
and returns a
pointer to it. |
static void |
reorder(UnitDefinition ud)
|
void |
setId(java.lang.String id)
Sets the id value with 'id'
|
void |
setListOfUnits(ListOf<Unit> listOfUnits)
Sets the
listOfUnits of this UnitDefinition . |
UnitDefinition |
simplify()
Simplifies the
UnitDefinition so that any Unit objects
occurring within the listOfUnits occurs only once. |
static UnitDefinition |
simplify(UnitDefinition ud)
Returns a simplified version of the given
UnitDefinition . |
static UnitDefinition |
substance(int level,
int version)
Returns the predefined unit for substance.
|
static UnitDefinition |
time(int level,
int version)
Returns the predefined unit for time.
|
java.lang.String |
toString()
Returns a String representing this SBase with all the
attributes that are defined.
|
boolean |
unsetListOfUnits()
Removes the
listOfUnits from this UnitDefinition and
notifies all registered instances of TreeNodeChangeListener . |
static UnitDefinition |
volume(int level,
int version)
Returns the predefined unit for volume.
|
isValidId
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendAnnotation, appendAnnotation, appendNotes, appendNotes, checkAndSetPackageNamespaceAndVersion, checkAndSetPackageNamespaceAndVersion, checkAttribute, checkIdentifier, checkLevelAndVersionCompatibility, createHistory, createPlugin, disablePackage, enablePackage, enablePackage, equals, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, fireNodeRemovedEvent, firePropertyChange, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementByMetaId, getElementBySId, getElementName, getExtension, getExtensionCount, getExtensionPackages, getHistory, getId, getIdManager, getLevel, getLevelAndVersion, getMetaId, getModel, getName, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getURI, getVersion, hashCode, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetId, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetName, isSetNotes, isSetPackageVErsion, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, isValidLevelAndVersionCombination, isValidMetaId, notifyChildChange, readAttribute, registerChild, removeCVTerm, removeCVTerm, setAnnotation, setAnnotation, setAnnotation, setHistory, setLevel, setLevelAndVersion, setMetaId, setName, setNamespace, setNotes, setNotes, setPackageNamespaceAndVersion, setPackageVersion, setParentSBML, setParentSBMLObject, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetId, unsetMetaId, unsetName, unsetNamespace, unsetNotes, unsetPlugin, unsetSBOTerm, writeXMLAttributes
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isLeaf, isReadingInProgress, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, setParent, userObjectKeySet
finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getName, isSetId, isSetName, setName, unsetId, unsetName
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendAnnotation, appendAnnotation, appendNotes, appendNotes, createPlugin, disablePackage, enablePackage, enablePackage, equals, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementByMetaId, getElementBySId, getElementName, getExtension, getExtensionCount, getExtensionPackages, getHistory, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getURI, getVersion, hashCode, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetPackageVErsion, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, readAttribute, registerChild, removeCVTerm, removeCVTerm, removeTreeNodeChangeListener, setAnnotation, setAnnotation, setAnnotation, setHistory, setLevel, setMetaId, setNotes, setNotes, setPackageVersion, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNotes, unsetPlugin, unsetSBOTerm, writeXMLAttributes
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeUserObject, userObjectKeySet
public static final java.lang.String AREA
UnitDefinition
area
.public static final java.lang.String EXTENT
UnitDefinition
extent
.public static final java.lang.String LENGTH
UnitDefinition
length
.private static final transient org.apache.log4j.Logger logger
public static final long serialVersionUID
public static final java.lang.String SUBSTANCE
UnitDefinition
substance
.public static final java.lang.String TIME
UnitDefinition
time
.public static final java.lang.String VOLUME
UnitDefinition
volume
.public static final java.lang.String BASE_UNIT_SUFFIX
UnitDefinition
objects that represent a base
Unit.Kind
with offset = 0, multiplier = 1, scale = 0, and exponent
= 1. Since SBML does not allow that the identifier of a
UnitDefinition
equals the name of a base unit, this suffix is used
to internally store simple units in form of a composite
UnitDefinition
.public UnitDefinition()
public UnitDefinition(int level, int version)
UnitDefinition
instance.level
- the SBML levelversion
- the SBML versionpublic UnitDefinition(java.lang.String id)
UnitDefinition
instance.id
- the unit definition id.public UnitDefinition(java.lang.String id, int level, int version)
UnitDefinition
instance from an id, level and version. By
default, the listOfUnit is null.id
- the unit definition id.level
- the SBML levelversion
- the SBML versionpublic UnitDefinition(java.lang.String id, java.lang.String name, int level, int version)
UnitDefinition
instance from an id, level and version. By
default, the listOfUnit is null.id
- the unit definition id.name
- the unit definition name.level
- the SBML levelversion
- the SBML versionpublic UnitDefinition(UnitDefinition unitDefinition)
UnitDefinition
instance from a given UnitDefinition.unitDefinition
- the UnitDefinition
to clone.public static final UnitDefinition area(int level, int version)
level
- the SBML levelversion
- the SBML versionpublic static boolean areCompatible(UnitDefinition ud1, UnitDefinition ud2)
Returns true
or false
depending on
whether two UnitDefinition objects are compatible.
For the purposes of performing this comparison, two
UnitDefinition
objects are considered compatible when they
contain compatible list of Unit
objects. This means two
UnitDefinition
objects are compatible if both satisfy the method
areEquivalent(UnitDefinition, UnitDefinition)
or one of both has
Unit.Kind.INVALID
as Unit.Kind
ud1
- the first UnitDefinition
object to compareud2
- the second UnitDefinition
object to comparetrue
if all the Unit
objects in ud1 are
compatible to the Unit
objects in ud2, false
otherwise.areIdentical(UnitDefinition, UnitDefinition)
,
Unit.areEquivalent(Unit, Unit)
public static boolean areEquivalent(UnitDefinition ud, java.lang.String units)
UnitDefinition
and the
UnitDefinition
or Unit
represented by the given
String
are equivalent.ud
- a UnitDefinition
units
- a String representing either a UnitDefinition
id or a unit Unit.Kind
.true
if both units are equivalentareEquivalent(UnitDefinition, UnitDefinition)
,
Unit.areEquivalent(Unit, Unit)
public static boolean areEquivalent(UnitDefinition ud1, UnitDefinition ud2)
Returns true or false depending on whether two
UnitDefinition
objects are equivalent.
For the purposes of performing this comparison, two UnitDefinition
objects are considered equivalent when they contain equivalent list of
Unit
objects. Unit
objects are in turn considered
equivalent if they satisfy the predicate
Unit.areEquivalent(Unit, Unit)
. The predicate tests a subset of the
objects's attributes.
ud1
- the first UnitDefinition
object to compareud2
- the second UnitDefinition
object to comparetrue
if all the Unit objects in ud1 are equivalent to
the Unit
objects in ud2, false
otherwise.areIdentical(UnitDefinition, UnitDefinition)
,
Unit.areEquivalent(Unit, String)
public static boolean areIdentical(UnitDefinition ud1, UnitDefinition ud2)
Returns true
or false
depending on
whether two UnitDefinition
objects are identical.
For the purposes of performing this comparison, two UnitDefinition
objects are considered identical when they contain identical lists of
Unit
objects. Pairs of Unit
objects in the lists are in
turn considered identical if they satisfy the predicate
Unit.areIdentical(Unit, Unit)
. The predicate compares every
attribute of the Unit
objects.
ud1
- the first UnitDefinition
object to compareud2
- the second UnitDefinition
object to comparetrue
if all the Unit
objects in ud1 are
identical to the Unit
objects of ud2, false
otherwise.public static final UnitDefinition getPredefinedUnit(java.lang.String id, int level, int version)
id
- one of the values
level
- a number greater than zero.version
- a number greater than zero.@Deprecated public static boolean isBuiltIn(UnitDefinition ud)
isPredefined()
ud
- a unit definitiontrue
if the given unit is a predefined unit.public static boolean isPredefined(java.lang.String name, int level)
name
- a unit Stringlevel
- the SBML leveltrue
if the given unit is a predefined unit.Unit.isPredefined(String, int)
public static boolean isPredefined(UnitDefinition ud)
ud
- a unit definitiontrue
if the given unit is a predefined unit.public static final UnitDefinition length(int level, int version)
level
- the SBML levelversion
- the SBML versionpublic static java.lang.String printUnits(UnitDefinition ud)
ud
- the UnitDefinition objectpublic static java.lang.String printUnits(UnitDefinition ud, boolean compact)
ud
- the UnitDefinition objectcompact
- boolean indicating whether the compact form should be used
(defaults to false)public static void reorder(UnitDefinition ud)
ud
- the UnitDefinition
object whose Unit
s are to be
reordered.public static UnitDefinition simplify(UnitDefinition ud)
UnitDefinition
.ud
- a unit definitionUnitDefinition
. In order
to make sure that the original UnitDefinition
is not
changed, it is cloned before the simplification.public static final UnitDefinition substance(int level, int version)
level
- the SBML levelversion
- the SBML versionpublic static final UnitDefinition time(int level, int version)
level
- the SBML levelversion
- the SBML versionpublic static final UnitDefinition volume(int level, int version)
level
- the SBML levelversion
- the SBML versionpublic void addUnit(java.lang.String unit)
unit
- the unit kind.public void addUnit(Unit u)
Unit
to this UnitDefinition
.u
- the unit to add.public void addUnit(Unit.Kind kind)
Unit
instance, with the given kind, to this UnitDefinition
.kind
- the unit kind.public void clear()
Unit
elements from the list of Units in this object.public UnitDefinition clone()
SBase
SBase
with the same
properties
like this one.clone
in interface SBase
clone
in class AbstractSBase
public void convertToSIUnits()
public Unit createUnit()
Unit
instance with the Unit.Kind.INVALID
kind.createInvalidUnit()
public Unit createInvalidUnit()
Unit
instance with the Unit.Kind.INVALID
kind.public UnitDefinition divideBy(UnitDefinition definition)
The current UnitDefinition
will be modified in the process.
definition
- a unit definitionUnitDefinition
instance for conveniencepublic boolean getAllowsChildren()
getAllowsChildren
in interface javax.swing.tree.TreeNode
getAllowsChildren
in class AbstractSBase
public javax.swing.tree.TreeNode getChildAt(int index)
getChildAt
in interface javax.swing.tree.TreeNode
getChildAt
in class AbstractSBase
public int getChildCount()
getChildCount
in interface javax.swing.tree.TreeNode
getChildCount
in class AbstractSBase
public ListOf<Unit> getListOfUnits()
public int getNumUnits()
public int getUnitCount()
public ListOf<UnitDefinition> getParent()
AbstractSBase
AbstractSBase.getParentSBMLObject()
, but this
method is needed for TreeNode
.getParent
in interface javax.swing.tree.TreeNode
getParent
in class AbstractSBase
AbstractSBase.getParentSBMLObject()
public Unit getUnit(int i)
i
- an integer, the index of the Unit to be returned.@Deprecated public boolean isBuiltIn()
isPredefined()
true
if this unit definition is a predefined unit.public boolean isIdMandatory()
SBase
true
if the identifier of this
SBase
is required to be defined (i.e., not null
)
in the definition of SBML.isIdMandatory
in interface NamedSBase
isIdMandatory
in interface SBase
isIdMandatory
in class AbstractSBase
true
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 isInvalid()
true
if this UnitDefinition is invalid.public boolean isListOfUnitsEmpty()
true
if the listOfUnits is empty.true
if the listOfUnits is empty.public boolean isPredefined()
true
if this unit definition is a predefined unit.public boolean isSetListOfUnits()
true
if the listOfUnits is not null and not empty.true
if the listOfUnits is not null and not empty.public boolean isUnitKind()
UnitDefinition
contains
exactly one Unit
that itself represents a Unit.Kind
, i.e.,
multiplier = 1, exponent = 1, scale = 1. Note that this method requires
the level and version attributes of this UnitDefinition
to be
set.true
if this UnitDefinition
contains
exactly one Unit
that itself represents a simple Unit.Kind
.public boolean isVariantOfArea()
true
if this UnitDefinition is a variant of Areatrue
if this UnitDefinition is a variant of Areapublic boolean isVariantOfDimensionless()
true
if this UnitDefinition is a variant of the predefined
unit
dimensionless; false otherwise.public boolean isVariantOfLength()
true
if this UnitDefinition is a variant of the predefined
unit
length, meaning metres with only arbitrary variations in scale or
multiplier values; false otherwise.public boolean isVariantOfSubstance()
true
if this UnitDefinition is a variant of the predefined
unit
substance, meaning moles or items (and grams or kilograms from
SBML Level 2 Version 2 onwards) with only arbitrary variations in
scale or multiplier values; false otherwise.public boolean isVariantOfSubstancePerArea()
true
if this UnitDefinition is a variant of the predefined
unit 'substance per area'.public boolean isVariantOfSubstancePerLength()
true
if this UnitDefinition is a variant of substance per
length.public boolean isVariantOfSubstancePerTime()
true
if this UnitDefinition is a variant of substance per time.public boolean isVariantOfSubstancePerVolume()
true
if this UnitDefinition is a variant of substance per
volume.public boolean isVariantOfTime()
true
if this UnitDefinition
is a variant of
the predefined unit time, meaning second with only arbitrary
variations in scale or multiplier values; false
otherwise.public boolean isVariantOfVolume()
true
if this UnitDefinition
is a variant of
the predefined unit volume, meaning litre or cubic metre with
only arbitrary variations in scale or multiplier values;
false
otherwise.public UnitDefinition multiplyWith(UnitDefinition definition)
definition
- a unit definitionUnitDefinition
for convenience.public UnitDefinition raiseByThePowerOf(double exponent)
exponent
- the exponentUnitDefinition
.public Unit removeUnit(int i)
Unit
object from this UnitDefinition
object
and returns a
pointer to it.
The caller owns the returned object and is responsible for deleting it.i
- the index of the Unit object to removeUnit
object removed. As mentioned above, the caller
owns the
returned item. null
is returned if the given index is out
of
range.public void setId(java.lang.String id)
SBase
setId
in interface NamedSBase
setId
in interface SBase
setId
in class AbstractSBase
id
- the id to setpublic void setListOfUnits(ListOf<Unit> listOfUnits)
listOfUnits
of this UnitDefinition
.
Automatically sets the parent SBML object of the list to this
UnitDefinition
instance.
listOfUnits
- the new list of Unit
s.public UnitDefinition simplify()
UnitDefinition
so that any Unit
objects
occurring within the listOfUnits
occurs only once. Unit
s
of Unit.Kind
Unit.Kind.INVALID
are treated like
Unit.Kind.DIMENSIONLESS
units and will therefore tend to disappear by
merging with other units.UnitDefinition
.public java.lang.String toString()
AbstractSBase
toString
in class AbstractSBase
public boolean unsetListOfUnits()
listOfUnits
from this UnitDefinition
and
notifies all registered instances of TreeNodeChangeListener
.true
if calling this method lead to a change in this
data structure.