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.
|
ignoredExtensions, ignoredXMLElements, lv
listOfListeners, 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()
Returns a hash code value for this
SBase instance. |
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)
Sets the given attribute in this
SBase . |
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()
Returns a map with all the attributes of this
SBase that
need to be written out in XML. |
containsUndeclaredUnits, getAllowsChildren, getChildAt, getChildCount, getDerivedUnitDefinition, getDerivedUnits, getFormula, getMath, getMathMLString, isSetMath, setFormula, unsetFormula, unsetMath
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendNotes, appendNotes, checkLevelAndVersionCompatibility, createHistory, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, fireNodeRemovedEvent, firePropertyChange, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementName, getExtension, getExtensionCount, getExtensionPackages, getHistory, getIdManager, 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, removeCVTerm, removeCVTerm, setAnnotation, setHistory, setLevel, setLevelAndVersion, setMetaId, setNamespace, setNotes, setNotes, setParentSBML, setParentSBMLObject, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNamespace, unsetNotes, unsetPlugin, unsetSBOTerm
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isLeaf, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, setParent, userObjectKeySet
finalize, getClass, notify, notifyAll, wait, wait, wait
containsUndeclaredUnits, getDerivedUnitDefinition, getDerivedUnits
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendNotes, appendNotes, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementName, getExtension, getExtensionCount, 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, removeCVTerm, removeCVTerm, removeTreeNodeChangeListener, setAnnotation, setHistory, setLevel, setMetaId, setNotes, setNotes, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNotes, unsetPlugin, unsetSBOTerm
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
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()
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()
SBase
SBase
with the same properties
like this one.clone
in interface SBase
clone
in class AbstractMathContainer
public boolean equals(java.lang.Object object)
SBase
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 NamedSBase
public java.lang.String getName()
getName
in interface NamedSBase
public int getNumArguments()
FunctionDefinition
.FunctionDefinition
.public int getArgumentCount()
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()
SBase
SBase
instance.hashCode
in interface SBase
hashCode
in class AbstractSBase
SBase
instance.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
true
if the id is not null
.public boolean isSetName()
isSetName
in interface NamedSBase
true
if the name is not null
.public boolean readAttribute(java.lang.String attributeName, java.lang.String prefix, java.lang.String value)
SBase
SBase
.
If the given attribute name is not recognized, nothing is done and
false
is returned.
readAttribute
in interface SBase
readAttribute
in class AbstractMathContainer
attributeName
- 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)
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
null
.unsetId
in interface NamedSBase
public void unsetName()
NamedSBase
null
.unsetName
in interface NamedSBase
public java.util.Map<java.lang.String,java.lang.String> writeXMLAttributes()
SBase
SBase
that
need to be written out in XML.
The attribute name is used as a key and the attribute value as value. If a prefix is needed for the attribute name, it need to be set directly in this map.
writeXMLAttributes
in interface SBase
writeXMLAttributes
in class AbstractMathContainer
Map
containing the XML attributes of this object.