public class LocalParameter extends Parameter
LocalParameter
has been introduced in SBML Level 3 to serve as the
object class for parameter definitions that are intended to be local to
a Reaction
. Objects of class LocalParameter
never appear at the Model
level they are always contained within ListOfLocalParameters
lists
which are in turn contained within KineticLaw
objects.
Like its global Parameter
counterpart, the LocalParameter
object class
is used to define a symbol associated with a value this symbol can then
be used in a model's mathematical formulas (and specifically, for
LocalParameter
, reaction rate formulas). Unlike Parameter
, the
LocalParameter
class does not have a 'constant' attribute: local
parameters within reactions are always constant.
LocalParameter
has one required attribute, 'id', to give the
parameter a unique identifier by which other parts of an SBML model
definition can refer to it. A parameter can also have an optional
'name' attribute of type string.
Identifiers and names must be used
according to the guidelines described in the SBML specifications.
The optional attribute 'value' determines the value (of type double
)
assigned to the parameter. A missing value for 'value' implies that
the value either is unknown, or to be obtained from an external source,
or determined by an initial assignment. The unit of measurement
associated with the value of the parameter can be specified using the
optional attribute 'units'. Here we only mention briefly some notable
points about the possible unit choices, but readers are urged to consult
the SBML specification documents for more information:
Model
object.
'substance'
, 'time'
, 'volume'
, 'area'
or
'length'
or the identifier of a new unit defined in the list of unit
definitions in the enclosing Model
structure. There are no constraints
on the units that can be chosen from these sets. There are no default
units for local parameters.
As with all other major SBML components, LocalParameter
is derived from
SBase
, and the methods defined on SBase
are available on LocalParameter
.
ListOfLocalParameters
,
LocalParameter
from Parameter
however, this
does not precisely match the object hierarchy defined by SBML
Level 3, where LocalParameter
is derived directly from SBase
and not
Parameter
. We believe this arrangement makes it easier for libSBML
users to program applications that work with both SBML Level 2 and
SBML Level 3, but programmers should also keep in mind this
difference exists. A side-effect of libSBML's scheme is that certain
methods on LocalParameter
that are inherited from Parameter
do not
actually have relevance to LocalParameter
objects. An example of this
is the methods pertaining to Parameter
's attribute 'constant'
(i.e., isSetConstant(), setConstant(), and getConstant()).
Constructor and Description |
---|
LocalParameter(LocalParameter orig)
Copy constructor creates a copy of a given
LocalParameter object. |
LocalParameter(long level,
long version)
|
LocalParameter(Parameter orig)
Copy constructor creates a
LocalParameter object by copying
the attributes of a given Parameter object. |
LocalParameter(SBMLNamespaces sbmlns)
|
Modifier and Type | Method and Description |
---|---|
LocalParameter |
cloneObject()
Creates and returns a deep copy of this
LocalParameter . |
void |
delete()
Explicitly deletes the underlying native object.
|
UnitDefinition |
getDerivedUnitDefinition()
Constructs and returns a
UnitDefinition that corresponds to the units
of this LocalParameter 's value. |
String |
getElementName()
Returns the XML element name of this object, which for
LocalParameter ,
is always 'localParameter'. |
int |
getTypeCode()
Returns the libSBML type code for this SBML object.
|
boolean |
hasRequiredAttributes()
Predicate returning
true if
all the required attributes for this LocalParameter object
have been set. |
getConstant, getId, getName, getUnits, getValue, initDefaults, isSetConstant, isSetId, isSetName, isSetUnits, isSetValue, renameUnitSIdRefs, setConstant, setId, setName, setUnits, setValue, unsetName, unsetUnits, unsetValue
addCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getElementByMetaId, getElementBySId, getLevel, getLine, getListOfAllElements, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isSetAnnotation, isSetMetaId, isSetModelHistory, isSetNotes, isSetSBOTerm, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeFromParentAndDelete, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, renameSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, unsetAnnotation, unsetCVTerms, unsetId, unsetMetaId, unsetModelHistory, unsetNotes, unsetSBOTerm
public LocalParameter(LocalParameter orig) throws SBMLConstructorException
LocalParameter
object.
orig
- the LocalParameter
instance to copy.
SBMLConstructorException
- Thrown if the argument orig
is null.
public LocalParameter(long level, long version) throws SBMLConstructorException
level
- a long integer, the SBML Level to assign to this
LocalParameter
.
version
- a long integer, the SBML Version to assign to this
LocalParameter
.
SBMLConstructorException
- Thrown if the given level
and version
combination, or this kind
of SBML object, are either invalid or mismatched with respect to the
parent SBMLDocument
object.
LocalParameter
object to an SBMLDocument
(e.g., using KineticLaw.addLocalParameter(LocalParameter p)
), the SBML Level, SBML
Version and XML namespace of the document override the
values used when creating the LocalParameter
object via this
constructor. This is necessary to ensure that an SBML document is a
consistent structure. Nevertheless, the ability to supply the values
at the time of creation of a LocalParameter
is an important aid to
producing valid SBML. Knowledge of the intented SBML Level and
Version determine whether it is valid to assign a particular value to
an attribute, or whether it is valid to add an object to an existing
SBMLDocument
.public LocalParameter(Parameter orig) throws SBMLConstructorException
LocalParameter
object by copying
the attributes of a given Parameter
object.
orig
- the Parameter
instance to copy.
SBMLConstructorException
- Thrown if the argument orig
is null.
public LocalParameter(SBMLNamespaces sbmlns) throws SBMLConstructorException
LocalParameter
object with the given SBMLNamespaces
object sbmlns
.
The SBMLNamespaces
object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core.
A common approach to using this class constructor is to create an
SBMLNamespaces
object somewhere in a program, once, then pass it to
object constructors such as this one when needed.
It is worth emphasizing that although this constructor does not take
an identifier argument, in SBML Level 2 and beyond, the 'id'
(identifier) attribute of a LocalParameter
is required to have a value.
Thus, callers are cautioned to assign a value after calling this
constructor if no identifier is provided as an argument. Setting the
identifier can be accomplished using the method
setId(String id).
sbmlns
- an SBMLNamespaces
object.
SBMLConstructorException
- Thrown if the given level
and version
combination, or this kind
of SBML object, are either invalid or mismatched with respect to the
parent SBMLDocument
object.
LocalParameter
object to an SBMLDocument
(e.g., using KineticLaw.addLocalParameter(LocalParameter p)
), the SBML XML namespace of
the document overrides the value used when creating the
LocalParameter
object via this constructor. This is necessary to
ensure that an SBML document is a consistent structure. Nevertheless,
the ability to supply the values at the time of creation of a
LocalParameter
is an important aid to producing valid SBML. Knowledge
of the intented SBML Level and Version determine whether it is valid
to assign a particular value to an attribute, or whether it is valid
to add an object to an existing SBMLDocument
.public LocalParameter cloneObject()
LocalParameter
.
cloneObject
 in class Parameter
LocalParameter
.public void delete()
In general, application software will not need to call this method directly. The Java language binding for libSBML is implemented as a language wrapper that provides a Java interface to libSBML's underlying C++/C code. Some of the Java methods return objects that are linked to objects created not by Java code, but by C++ code. The Java objects wrapped around them will be deleted when the garbage collector invokes the corresponding C++ finalize()
methods for the objects. The finalize()
methods in turn call the LocalParameter.delete()
method on the libSBML object.
This method is exposed in case calling programs want to ensure that the underlying object is freed immediately, and not at some arbitrary time determined by the Java garbage collector. In normal usage, callers do not need to invoke LocalParameter.delete()
themselves.
public UnitDefinition getDerivedUnitDefinition()
UnitDefinition
that corresponds to the units
of this LocalParameter
's value.
LocalParameters in SBML have an attribute ('units') for declaring the
units of measurement intended for the parameter's value. No
defaults are defined by SBML in the absence of a definition for
'units'. This method returns a UnitDefinition
object based on the
units declared for this LocalParameter
using its 'units' attribute, or
it returns null
if no units have been declared.
Note that unit declarations for LocalParameter
objects are specified
in terms of the identifier of a unit (e.g., using setUnits()), but
this method returns a UnitDefinition
object, not a unit
identifier. It does this by constructing an appropriate
UnitDefinition
. For SBML Level 2 models, it will do this even
when the value of the 'units' attribute is one of the predefined SBML
units 'substance'
, 'volume'
, 'area'
, 'length'
or
'time'.
Callers may find this useful in conjunction with the helper
methods provided by the UnitDefinition
class for comparing different
UnitDefinition
objects.
getDerivedUnitDefinition
 in class Parameter
UnitDefinition
that expresses the units of this
LocalParameter
, or null
if one cannot be constructed.
Parameter.isSetUnits()
LocalParameter
object has not yet been
added to a model, or the model itself is incomplete, unit analysis is
not possible, and consequently this method will return null.
public String getElementName()
LocalParameter
,
is always 'localParameter'.
getElementName
 in class Parameter
'localParameter'.
public int getTypeCode()
LibSBML attaches an identifying code to every
kind of SBML object. These are known as SBML type codes. In
other languages, the set of type codes is stored in an enumeration in
the Java language interface for libSBML, the type codes are defined as
static integer constants in the interface class libsbmlConstants
. The names of the type codes all begin with the
characters SBML_.
getTypeCode
 in class Parameter
SBML_UNKNOWN
(default).
LocalParameter.getElementName()
public boolean hasRequiredAttributes()
true
if
all the required attributes for this LocalParameter
object
have been set.
hasRequiredAttributes
 in class Parameter
LocalParameter
object are: