public class CalcUtil
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
CalcUtil(com.labvantage.sapphire.services.ConnectionInfo connectionInfo)
Creates a new instance of CalcUtil using the connectionInfo specified
|
CalcUtil(java.io.File rakFile,
java.lang.String connectionid)
Constructor for a client application with an existing connection
|
CalcUtil(PageContext pageContext)
Creates a new instance of CalcUtil using the pageContext specified
|
Modifier and Type | Method and Description |
---|---|
java.math.BigDecimal |
convertUnits(java.math.BigDecimal value,
java.lang.String fromUnit,
java.lang.String toUnit)
Unit conversion of a value between two specified units
|
java.lang.String |
evaluate(java.lang.String expression,
java.util.HashMap params)
Evaluates the expression substituting the params specified
|
public CalcUtil(com.labvantage.sapphire.services.ConnectionInfo connectionInfo)
connectionInfo
- The connectionInfo that contains user connection detailspublic CalcUtil(PageContext pageContext)
pageContext
- The pageContext from inside a jsp page.public CalcUtil(java.io.File rakFile, java.lang.String connectionid)
rakFile
- A remote access key fileconnectionid
- A valid connectionidpublic java.lang.String evaluate(java.lang.String expression, java.util.HashMap params) throws SapphireException
expression
- The expression to be evaluatedparams
- The hashmap of the params to be substituted in the expressionSapphireException
public java.math.BigDecimal convertUnits(java.math.BigDecimal value, java.lang.String fromUnit, java.lang.String toUnit) throws SapphireException
value
- The numeric value that needs to be converted from one units to the otherfromUnit
- The units in which the value currently is.toUnit
- The units to which the value is to be converted to.SapphireException