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
.
In SBML Level 3 Version 2, the scope of the LocalParameter
was expanded slightly to officially encompass the entire Reaction
instead of just the KineticLaw
in which it appears. This has no
effect on models using only SBML Level 3 Core constructs,
but has the potential to allow SBML Level 3 Packages to
include elements in a Reaction
that could reference a
LocalParameter
from that Reaction
's KineticLaw
. It also means that
no LocalParameter
may have the same 'id'
as a referenced Species
in any SimpleSpeciesReference
in that Reaction
.
ListOfLocalParameters
,
KineticLaw
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 object. |
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. |
java.lang.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, unsetConstant, unsetName, unsetUnits, unsetValue
addCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, connectToChild, deleteDisabledPlugins, deleteDisabledPlugins, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getDisabledPlugin, getElementByMetaId, getElementBySId, getIdAttribute, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumDisabledPlugins, getNumPlugins, getPackageCoreVersion, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetIdAttribute, isSetMetaId, isSetModelHistory, isSetNotes, isSetSBOTerm, isSetUserData, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeFromParentAndDelete, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, renameSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setIdAttribute, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetId, unsetIdAttribute, unsetMetaId, unsetModelHistory, unsetNotes, unsetSBOTerm, unsetUserData
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 are invalid
or if this object is incompatible with the given level and version.
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute.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 libSBML's SBMLNamespaces
facilities is to create an
SBMLNamespaces
object somewhere in a program once, then hand that object
as needed to object constructors that accept SBMLNamespaces
as arguments.
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 sbmlns
is inconsistent or incompatible
with this object.
SBMLDocument
having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument
), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute.public LocalParameter(LocalParameter orig) throws SBMLConstructorException
LocalParameter
object.
orig
- the LocalParameter
instance to copy.SBMLConstructorException
public LocalParameter(Parameter orig) throws SBMLConstructorException
LocalParameter
object by copying
the attributes of a given Parameter
object.
orig
- the Parameter
instance to copy.SBMLConstructorException
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 LocalParameter cloneObject()
LocalParameter
object.
cloneObject
 in class Parameter
LocalParameter
object.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 int getTypeCode()
LibSBML attaches an identifying code to every kind of SBML object. These
are integer constants known as SBML type codes. The names of all
the codes begin with the characters SBML_
.
In the Java language interface for libSBML, the
type codes are defined as static integer constants in the interface class
libsbmlConstants
. Note that different Level 3
package plug-ins may use overlapping type codes to identify the package
to which a given object belongs, call the
method on the object.
SBase.getPackageName()
getTypeCode
 in class Parameter
SBML_LOCAL_PARAMETER
(default).
LocalParameter.getElementName()
,
SBase.getPackageName()
public java.lang.String getElementName()
LocalParameter
,
is always 'localParameter'.
getElementName
 in class Parameter
'localParameter'.
public boolean hasRequiredAttributes()
true
if all the required attributes for this
LocalParameter
object have been set.
The required attributes for a LocalParameter
object are:
hasRequiredAttributes
 in class Parameter
true
if the required attributes have been set, false
otherwise.