org.sbml.jsbml
public class FunctionDefinition extends AbstractMathContainer implements CallableSBase, UniqueNamedSBase
FunctionDefinition
s were introduced to SBML in Level 2, this
class must not be used for models in Level 1.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
id
Represents the "id" attribute of a functionDefinition element.
|
private static java.lang.String |
ILLEGAL_ASTNODE_TYPE_MSG
Error message to indicate that an incorrect
ASTNode.Type has been passed
to a method. |
private java.lang.String |
name
Represents the "name" attribute of a functionDefinition element.
|
private static long |
serialVersionUID
Generated serial version identifier.
|
lv
listOfListeners, parent
Constructor and Description |
---|
FunctionDefinition()
Creates a FunctionDefinition instance.
|
FunctionDefinition(FunctionDefinition sb)
Creates a FunctionDefinition instance from a given FunctionDefinition.
|
FunctionDefinition(int level,
int version)
Creates a FunctionDefinition instance from a level and version.
|
FunctionDefinition(java.lang.String id,
ASTNode lambda,
int level,
int version)
Creates a FunctionDefinition instance from an id, ASTNode, level and
version.
|
FunctionDefinition(java.lang.String id,
int level,
int version)
Creates a FunctionDefinition instance from an id, 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.
|
FunctionDefinition |
clone()
Creates a copy of this object, i.e., e new
SBase with the same properties
like this one and returns a pointer to it. |
boolean |
equals(java.lang.Object object)
|
ASTNode |
getArgument(int n)
Get the nth argument to this function.
|
ASTNode |
getArgument(java.lang.String name)
Get the argument named name to this
FunctionDefinition . |
ASTNode |
getBody()
Get the mathematical expression that is the body of this
FunctionDefinition object. |
java.lang.String |
getId() |
java.lang.String |
getName() |
int |
getNumArguments()
Get the number of arguments (bound variables) taken by this
FunctionDefinition . |
ListOf<FunctionDefinition> |
getParent()
This is equivalent to calling
AbstractSBase.getParentSBMLObject() , but this
method is needed for TreeNode . |
int |
hashCode() |
boolean |
isIdMandatory()
This method can be used to query if the identifier of this
NamedSBase is
required to be defined (i.e., not null) in the definition of SBML. |
boolean |
isSetId() |
boolean |
isSetName() |
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 |
setFormula(java.lang.String formula)
Sets the mathematical expression of this
MathContainer instance
to the given formula. |
void |
setId(java.lang.String id)
sets the id value with 'id'
|
void |
setMath(ASTNode math)
Sets the math
ASTNode of this MathContainer to the given
value. |
void |
setName(java.lang.String name)
sets the name value with 'name'.
|
java.lang.String |
toString() |
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() |
containsUndeclaredUnits, getAllowsChildren, getChildAt, getChildCount, getDerivedUnitDefinition, getDerivedUnits, getFormula, getMath, getMathMLString, isSetMath, unsetFormula, unsetMath
addCVTerm, addDeclaredNamespace, addNamespace, appendNotes, appendNotes, checkLevelAndVersionCompatibility, filterCVTerms, filterCVTerms, fireNodeRemovedEvent, getAnnotation, getAnnotationString, getCVTerm, getCVTerms, getDeclaredNamespaces, getElementName, getHistory, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespaces, getNotes, getNotesString, getNumCVTerms, getParentSBMLObject, getSBMLDocument, getSBOTerm, getSBOTermID, getVersion, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetParentSBMLObject, isSetSBOTerm, isSetVersion, isValidLevelAndVersionCombination, notifyChildChange, registerChild, removeNamespace, setAnnotation, setHistory, setLevel, setLevelAndVersion, setMetaId, setNotes, setNotes, setParentSBML, setParentSBMLObject, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregister, unsetAnnotation, unsetCVTerms, unsetHistory, unsetMetaId, unsetNotes, unsetSBOTerm
addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, fireNodeAddedEvent, firePropertyChange, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getTreeNodeChangeListenerCount, indexOf, isLeaf, isRoot, isSetParent, removeAllTreeNodeChangeListeners, removeTreeNodeChangeListener, removeTreeNodeChangeListener, setParent
finalize, getClass, notify, notifyAll, wait, wait, wait
containsUndeclaredUnits, getDerivedUnitDefinition, getDerivedUnits
addCVTerm, addDeclaredNamespace, addNamespace, appendNotes, appendNotes, filterCVTerms, filterCVTerms, getAnnotation, getAnnotationString, getCVTerm, getCVTerms, getDeclaredNamespaces, getElementName, getHistory, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespaces, getNotes, getNotesString, getNumCVTerms, getParentSBMLObject, getSBMLDocument, getSBOTerm, getSBOTermID, getVersion, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetParentSBMLObject, isSetSBOTerm, isSetVersion, registerChild, removeTreeNodeChangeListener, setAnnotation, setHistory, setLevel, setMetaId, setNotes, setNotes, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregister, unsetAnnotation, unsetCVTerms, unsetHistory, unsetMetaId, unsetNotes, unsetSBOTerm
addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getListOfTreeNodeChangeListeners, getTreeNodeChangeListenerCount, isRoot, isSetParent, removeAllTreeNodeChangeListeners, removeTreeNodeChangeListener
private static final java.lang.String ILLEGAL_ASTNODE_TYPE_MSG
ASTNode.Type
has been passed
to a method.private static final long serialVersionUID
private java.lang.String id
private java.lang.String name
public FunctionDefinition()
public FunctionDefinition(FunctionDefinition sb)
sb
- public FunctionDefinition(int level, int version)
level
- version
- public FunctionDefinition(java.lang.String id, ASTNode lambda, int level, int version)
id
- lambda
- level
- version
- public FunctionDefinition(java.lang.String id, int level, int version)
id
- level
- version
- 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 FunctionDefinition clone()
SBase
SBase
with the same properties
like this one and returns a pointer to it.clone
in interface SBase
clone
in class AbstractMathContainer
public boolean equals(java.lang.Object object)
SBase
SBase
has exactly the same
properties like this SBase
instance.equals
in interface SBase
equals
in class AbstractSBase
Object
is an instance of
SBase
that has exactly the same properties like this
SBase instance.public ASTNode getArgument(int n)
getNumArguments()
.n
- an integer index for the argument sought.FunctionDefinition
.public ASTNode getArgument(java.lang.String name)
FunctionDefinition
.name
- the exact name (case-sensitive) of the sought-after argumentpublic ASTNode getBody()
FunctionDefinition
object.FunctionDefinition
as an Abstract Syntax
Tree, or null if no body is defined.public java.lang.String getId()
getId
in interface NamedSBase
public java.lang.String getName()
getName
in interface NamedSBase
public int getNumArguments()
FunctionDefinition
.FunctionDefinition
.public ListOf<FunctionDefinition> 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 int hashCode()
hashCode
in interface SBase
hashCode
in class AbstractSBase
Object.hashCode()
public boolean isIdMandatory()
NamedSBase
NamedSBase
is
required to be defined (i.e., not null) in the definition of SBML.isIdMandatory
in interface NamedSBase
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 isSetId()
isSetId
in interface NamedSBase
public boolean isSetName()
isSetName
in interface NamedSBase
public boolean readAttribute(java.lang.String attributeName, java.lang.String prefix, java.lang.String value)
SBase
readAttribute
in interface SBase
readAttribute
in class AbstractMathContainer
attributeName
- : localName of the XML attributeprefix
- : prefix of the XML attributevalue
- : value of the XML attributepublic void setFormula(java.lang.String formula) throws ParseException
MathContainer
MathContainer
instance
to the given formula. This method parses the given String
and
stores the result in an ASTNode
object.setFormula
in interface MathContainer
setFormula
in class AbstractMathContainer
formula
- a C-like String
according to the definition in the
SBML Level 1 specifications.ParseException
- If the given formula is invalid or cannot be parsed properly.public void setId(java.lang.String id)
NamedSBase
setId
in interface NamedSBase
public void setMath(ASTNode math)
MathContainer
ASTNode
of this MathContainer
to the given
value.setMath
in interface MathContainer
setMath
in class AbstractMathContainer
math
- an abstract syntax tree.public void setName(java.lang.String name)
NamedSBase
setName
in interface NamedSBase
public java.lang.String toString()
toString
in class AbstractMathContainer
public void unsetId()
NamedSBase
unsetId
in interface NamedSBase
public void unsetName()
NamedSBase
unsetName
in interface NamedSBase
public java.util.Map<java.lang.String,java.lang.String> writeXMLAttributes()
writeXMLAttributes
in interface SBase
writeXMLAttributes
in class AbstractMathContainer
Map
containing the XML attributes of this object.