org.sbml.jsbml
public class FunctionDefinition extends AbstractMathContainer implements CallableSBase, UniqueNamedSBase
FunctionDefinitions 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.
|
ignoredExtensions, ignoredXMLElements, lvlistOfListeners, parent, UNKNOWN_ATTRIBUTES, UNKNOWN_ELEMENTS| 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 deep copy of this object, i.e., a new
SBase with the same properties
like this one. |
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. |
int |
getArgumentCount()
Get the number of arguments (bound variables) taken by 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 |
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, setFormula, unsetFormula, unsetMathaddCVTerm, addDeclaredNamespace, addExtension, appendNotes, appendNotes, checkLevelAndVersionCompatibility, createHistory, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, fireNodeRemovedEvent, 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, 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, unsetSBOTermaddAllChangeListeners, 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, userObjectKeySetfinalize, getClass, notify, notifyAll, wait, wait, waitcontainsUndeclaredUnits, getDerivedUnitDefinition, getDerivedUnitsaddCVTerm, 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, registerChild, removeTreeNodeChangeListener, setAnnotation, setHistory, setLevel, setMetaId, setNotes, setNotes, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregister, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNotes, unsetPlugin, unsetSBOTermaddAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeUserObject, userObjectKeySetprivate 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()
null.public FunctionDefinition(FunctionDefinition sb)
sb - public FunctionDefinition(int level,
int version)
null.level - version - public FunctionDefinition(java.lang.String id,
ASTNode lambda,
int level,
int version)
null. If the ASTNode is not of type lambda,
an IllegalArgumentException is thrown.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()
SBaseSBase with the same properties
like this one.clone in interface SBaseclone in class AbstractMathContainerpublic boolean equals(java.lang.Object object)
SBasetrue if and only if the given SBase has exactly the same
properties like this SBase instance.equals in interface SBaseequals in class AbstractSBasetrue if and only if the given Object is an instance of
SBase that has exactly the same properties like this
SBase instance.public ASTNode getArgument(int n)
getArgumentCount().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 NamedSBasepublic java.lang.String getName()
getName in interface NamedSBasepublic int getNumArguments()
FunctionDefinition.FunctionDefinition.public int getArgumentCount()
FunctionDefinition.FunctionDefinition.public ListOf<FunctionDefinition> getParent()
AbstractSBaseAbstractSBase.getParentSBMLObject(), but this
method is needed for TreeNode.getParent in interface javax.swing.tree.TreeNodegetParent in class AbstractSBaseAbstractSBase.getParentSBMLObject()public int hashCode()
hashCode in interface SBasehashCode in class AbstractSBaseObject.hashCode()public boolean isIdMandatory()
NamedSBaseNamedSBase is required to be defined (i.e., not null)
in the definition of SBML.isIdMandatory in interface NamedSBasetrue 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 NamedSBasetrue if the id is not null.public boolean isSetName()
isSetName in interface NamedSBasetrue if the name is not null.public boolean readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value)
SBasereadAttribute in interface SBasereadAttribute in class AbstractMathContainerattributeName - localName of the XML attributeprefix - prefix of the XML attributevalue - value of the XML attributetrue if the attribute has been successfully read.public void setId(java.lang.String id)
NamedSBasesetId in interface NamedSBasepublic void setMath(ASTNode math)
MathContainerASTNode of this MathContainer to the given
value.setMath in interface MathContainersetMath in class AbstractMathContainermath - an abstract syntax tree.public void setName(java.lang.String name)
NamedSBasesetName in interface NamedSBasepublic java.lang.String toString()
toString in class AbstractMathContainerpublic void unsetId()
NamedSBasenull.unsetId in interface NamedSBasepublic void unsetName()
NamedSBasenull.unsetName in interface NamedSBasepublic java.util.Map<java.lang.String,java.lang.String> writeXMLAttributes()
writeXMLAttributes in interface SBasewriteXMLAttributes in class AbstractMathContainerMap containing the XML attributes of this object.