Package ise.antelope.tasks
Class Op
- java.lang.Object
-
- ise.antelope.tasks.Op
-
public class Op extends java.lang.Object
Represents a mathematical operation.Copyright 2003, Dale Anson, all rights reserved
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConfiguredNum(Num num)
Add a number to this operation.void
addConfiguredOp(Op op)
Add a nested operation.Num
calculate()
Perform this operation.void
setDatatype(java.lang.String p)
Sets the datatype of this calculation.void
setOp(java.lang.String op)
Set the operation.void
setStrict(boolean b)
Use the StrictMath library.
-
-
-
Method Detail
-
setOp
public void setOp(java.lang.String op)
Set the operation.
-
addConfiguredNum
public void addConfiguredNum(Num num)
Add a number to this operation. An operation can hold any number of numbers to support formulas like 5 + 4 + 3 + 2 + 1.- Parameters:
num
- a number to use in this operation
-
setDatatype
public void setDatatype(java.lang.String p)
Sets the datatype of this calculation. Allowed values are "int", "long", "float", or "double".
-
addConfiguredOp
public void addConfiguredOp(Op op)
Add a nested operation.- Parameters:
op
- the operation to add.
-
setStrict
public void setStrict(boolean b)
Use the StrictMath library.
-
calculate
public Num calculate()
Perform this operation.- Returns:
- the value resulting from the calculation as a Num.
-
-