Class JExprMath
- java.lang.Object
-
- com.inductiveautomation.snap.javatree.JNode
-
- com.inductiveautomation.snap.javatree.JExpr
-
- com.inductiveautomation.snap.javatree.JExprMath
-
public class JExprMath extends JExpr
An class to represent expressions that include an operator (math, logical, etc.).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JExprMath.Op
-
Nested classes/interfaces inherited from class com.inductiveautomation.snap.javatree.JExpr
JExpr.AllocationExpr, JExpr.ArrayIndexExpr, JExpr.CastExpr
-
-
Field Summary
Fields Modifier and Type Field Description JExprMath.Op
op
-
Constructor Summary
Constructors Constructor Description JExprMath()
Creates a new expression.JExprMath(JExprMath.Op anOp, JExpr aFirst)
Creates a new expression for given op and LeftHand expression.JExprMath(JExprMath.Op anOp, JExpr aFirst, JExpr aSecond)
Creates a new expression for given op and LeftHand/RightHand expressions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
buildChildren()
Add operands to children.protected java.lang.String
getClassNameImpl()
Returns the class name for expression.java.lang.String
getNodeString()
Returns the part name.JExprMath.Op
getOp()
Returns the op.JExpr
getOperand(int anIndex)
Returns the specified operand.int
getOperandCount()
Returns the operand count.void
setOperand(JExpr anExpr, int anIndex)
Sets the specified operand.-
Methods inherited from class com.inductiveautomation.snap.javatree.JExpr
getParentClassRef, getParentExpr
-
Methods inherited from class com.inductiveautomation.snap.javatree.JNode
addChild, getBlock, getChild, getChildCount, getChildren, getClassLoader, getClassName, getClassRef, getClassRefImpl, getEnclosingClassDecl, getEnclosingMemberDecl, getEnclosingMethodDecl, getEnd, getEndToken, getFile, getJClass, getLineIndex, getName, getNameImpl, getNodeAtCharIndex, getNodeFields, getNodeFieldsImpl, getNodeParents, getNodePath, getOthers, getParent, getParent, getReferencedClasses, getReferencedClassNames, getReferencedClassNames, getReferencedClassNames, getStart, getStartToken, getString, getVariableDecl, getVariableDeclInside, getVariableDecls, isBlock, setClassName, setClassRef, setEndToken, setJClass, setParent, setStartToken, toString
-
-
-
-
Field Detail
-
op
public JExprMath.Op op
-
-
Constructor Detail
-
JExprMath
public JExprMath()
Creates a new expression.
-
JExprMath
public JExprMath(JExprMath.Op anOp, JExpr aFirst)
Creates a new expression for given op and LeftHand expression.
-
JExprMath
public JExprMath(JExprMath.Op anOp, JExpr aFirst, JExpr aSecond)
Creates a new expression for given op and LeftHand/RightHand expressions.
-
-
Method Detail
-
getOp
public JExprMath.Op getOp()
Returns the op.
-
getOperandCount
public int getOperandCount()
Returns the operand count.
-
getOperand
public JExpr getOperand(int anIndex)
Returns the specified operand.
-
setOperand
public void setOperand(JExpr anExpr, int anIndex)
Sets the specified operand.
-
getClassNameImpl
protected java.lang.String getClassNameImpl()
Returns the class name for expression.- Overrides:
getClassNameImpl
in classJNode
-
getNodeString
public java.lang.String getNodeString()
Returns the part name.- Overrides:
getNodeString
in classJNode
-
buildChildren
protected void buildChildren()
Add operands to children.- Overrides:
buildChildren
in classJNode
-
-