org.sbml.jsbml.math
T
- public class ASTCnNumberNode<T> extends ASTNumber
Modifier and Type | Field and Description |
---|---|
private static org.apache.log4j.Logger |
logger
A
Logger for this class. |
protected T |
number
Numerical base for MathML element
|
private static long |
serialVersionUID |
private java.lang.String |
units
units attribute for MathML element
|
private java.lang.String |
variable
variable attribute for MathML element
|
id, mathMLClass, parentSBMLObject, strict, style, type
listOfListeners, parent, resourceBundle, UNKNOWN_ATTRIBUTES, UNKNOWN_ELEMENTS
Constructor and Description |
---|
ASTCnNumberNode()
Creates a new
ASTCnNumberNode that lacks a pointer
to its containing MathContainer . |
ASTCnNumberNode(ASTCnNumberNode<T> node)
Copy constructor; Creates a deep copy of the given
ASTCnNumberNode . |
ASTCnNumberNode(java.lang.String variable)
Creates a new
ASTCnNumberNode that lacks a pointer
to its containing MathContainer and has a variable
String . |
Modifier and Type | Method and Description |
---|---|
ASTCnNumberNode<T> |
clone()
Clone ASTNode2
|
ASTNode2Value<?> |
compile(ASTNode2Compiler compiler)
Compiles this
ASTNode2 and returns the result. |
UnitDefinition |
deriveUnit()
Evaluates recursively this
ASTCnNumberNode and creates a new
UnitDefinition with respect to all referenced elements. |
boolean |
equals(java.lang.Object obj) |
T |
getNumber()
Get the numerical base of MathML element.
|
java.lang.String |
getUnits()
Returns the units of the MathML element represented by this ASTCnNumberNode
|
UnitDefinition |
getUnitsInstance()
Creates or obtains a
UnitDefinition corresponding to the unit
that has been set for this ASTCnNumberNode and returns a pointer to it. |
java.lang.String |
getVariable()
Get the variable for this
ASTNumber node |
int |
hashCode() |
boolean |
hasUnits()
Returns
true if the current ASTCnNumberNode or
any of its descendants has a unit defined. |
boolean |
isAllowableType(ASTNode.Type type)
Returns
true iff type is allowed in this ASTNode2 |
protected boolean |
isSetNumber()
Returns True iff base has been set
|
boolean |
isSetUnits()
Returns True iff units has been set
|
protected boolean |
isSetVariable()
Returns true iff this
ASTNumber node
represents a variable. |
void |
setNumber(T number)
Set the numerical base of MathML element.
|
void |
setUnits(java.lang.String units)
Set the units of the MathML element represented by this ASTCnNumberNode
|
void |
setVariable(java.lang.String variable)
Set the variable for this
ASTNumber node |
java.lang.String |
toString() |
void |
unsetUnits()
Unset the units attribute.
|
getAllowsChildren, getChildAt, getChildCount
getId, getMathMLClass, getParentSBMLObject, getStyle, getType, isSetId, isSetMathMLClass, isSetParentSBMLObject, isSetStyle, isSetType, isStrict, processValue, setId, setMathMLClass, setParent, setParentSBMLObject, setStrictness, setStyle, setType, setType, toFormula, toLaTeX, toMathML, unsetParentSBMLObject
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getParent, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isLeaf, isRoot, isSetParent, isSetUserObjects, notifyChildChange, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, userObjectKeySet
finalize, getClass, notify, notifyAll, wait, wait, wait
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, userObjectKeySet
private static final long serialVersionUID
private static final org.apache.log4j.Logger logger
Logger
for this class.protected T number
private java.lang.String units
private java.lang.String variable
public ASTCnNumberNode()
ASTCnNumberNode
that lacks a pointer
to its containing MathContainer
.public ASTCnNumberNode(ASTCnNumberNode<T> node)
ASTCnNumberNode
.node
- the ASTCnNumberNode
to be copied.public ASTCnNumberNode(java.lang.String variable)
ASTCnNumberNode
that lacks a pointer
to its containing MathContainer
and has a variable
String
.variable
- public ASTCnNumberNode<T> clone()
ASTNode2
public ASTNode2Value<?> compile(ASTNode2Compiler compiler)
ASTNode2
ASTNode2
and returns the result.compiler
- An instance of an ASTNode2Compiler
that provides
methods to translate this ASTNode2
into something
different.ASTNode2Value
. The content of the
wrapper depends on the ASTNode2Compiler
used to create it.
However, this ASTNode2
will ensure that level and version
are set appropriately according to this node's parent SBML
object.public UnitDefinition deriveUnit() throws SBMLException
ASTCnNumberNode
and creates a new
UnitDefinition with respect to all referenced elements.SBMLException
- if they are problems going through the ASTNode2
tree.public boolean equals(java.lang.Object obj)
equals
in class AbstractASTNode
public T getNumber()
PropertyUndefinedError
public java.lang.String getUnits()
public UnitDefinition getUnitsInstance()
UnitDefinition
corresponding to the unit
that has been set for this ASTCnNumberNode
and returns a pointer to it.
Note that in case that this ASTCnNumberNode
is associated with a
Unit.Kind
, the created UnitDefinition
will not be part of the
model, it is just a container for the Unit.Kind
.UnitDefinition
or null
.public java.lang.String getVariable()
ASTNumber
nodeString
public int hashCode()
hashCode
in class AbstractASTNode
public boolean hasUnits()
true
if the current ASTCnNumberNode
or
any of its descendants has a unit defined.true
if the current ASTCnNumberNode
or
any of its descendants has a unit defined.public boolean isAllowableType(ASTNode.Type type)
ASTNode2
true
iff type is allowed in this ASTNode2
protected boolean isSetNumber()
public boolean isSetUnits()
protected boolean isSetVariable()
ASTNumber
node
represents a variable.public void setNumber(T number)
number
- public void setUnits(java.lang.String units)
units
- public void setVariable(java.lang.String variable)
ASTNumber
nodevariable
- String
public java.lang.String toString()
public void unsetUnits()