public class PriceEquationCalculationCmdImpl extends com.ibm.websphere.command.CacheableCommandImpl implements PriceEquationCalculationCmd
Modifier and Type | Class and Description |
---|---|
protected class | PriceEquationCalculationCmdImpl.Operand
The object class representing an operand in price equation.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String | CLASSNAME
The name of this class.
|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
PriceEquationCalculationCmdImpl() |
Modifier and Type | Method and Description |
---|---|
protected PriceEquationCalculationCmdImpl.Operand | calculate(java.lang.String operator, PriceEquationCalculationCmdImpl.Operand operand1, PriceEquationCalculationCmdImpl.Operand operand2)
This method calculates the result with two operands and a specified operator.
|
protected com.ibm.commerce.price.rule.runtime.objects.PriceEquationResultObject | calculatePriceEquation()
This method calculates the price equation.
|
java.lang.String | getCatentryId()
Get the catalog entry ID.
|
java.lang.String | getCurrency()
Get the currency.
|
java.lang.String | getExpression()
Get the representing expression of price equation.
|
boolean | getFlag()
Get the flag of getUnitOnly.
|
java.math.BigDecimal | getInputPrice()
Get the input price.
|
com.ibm.commerce.price.rule.runtime.objects.PriceEquationResultObject | getPriceEquationResultObject()
Get the price equation result object.
|
java.lang.Double | getQuantity()
Get the quantity.
|
protected java.util.Map | getRuntimeParametersMap()
Get the runtime parameters.
|
java.lang.Integer | getStoreId()
Get the store ID.
|
java.lang.String | getUom()
Get the unit of measurement.
|
protected PriceEquationCalculationCmdImpl.Operand | getValueFromPriceConstant(java.lang.String token)
This method retrieves the value of the price constant which is specified in the token parameter.
|
protected PriceEquationCalculationCmdImpl.Operand | getValueFromPriceList(java.lang.String token)
This method retrieves the offer price for the catalog entry in the price list which is specified in the token parameter.
|
boolean | isReadyToCallExecute()
This method returns true.
|
void | performExecute()
The main logic to execute the command.
|
protected java.lang.String | resolveEquationType(java.lang.String euqationUom)
The method resolves the type of price equation according to the unit.
|
protected java.lang.String | resolveUniqueID(java.lang.String token)
The method resolves the unique ID for price constant or price list from the string which is in the format of PriceConstant[uniqueID] or PriceList[uniqueID].
|
protected java.lang.String | resolveUomForAddOrSubtract(java.lang.String uom1, java.lang.String uom2)
This method resolves the resulting unit of add and subtract operation according to the units of two operands.
|
protected java.lang.String | resolveUomForDivide(java.lang.String uom1, java.lang.String uom2)
This method resolves the resulting unit of division operation according to the units of two operands.
|
protected java.lang.String | resolveUomForMultiply(java.lang.String uom1, java.lang.String uom2)
This method resolves the resulting unit of multiply operation according to the units of two operands.
|
protected PriceEquationCalculationCmdImpl.Operand | retrieveOperandValue(PriceEquationCalculationCmdImpl.Operand operand)
This method retrieves the value of the operand.
|
void | setCatEntryId(java.lang.String catEntryId)
Set the catalog entry ID.
|
void | setCurrency(java.lang.String currency)
Set the currency.
|
void | setEquationExpression(java.lang.String expression)
Set the representing expression of price equation.
|
void | setFlag(boolean flag)
Set the flag of getUnitOnly.
|
void | setInputPrice(java.math.BigDecimal inputPrice)
Set the input price.
|
void | setQuantity(java.lang.Double quantity)
Set the quantity.
|
void | setRuntimeParameters(java.util.Map runtimeParameters)
Set the runtime parameters from the price rule engine.
|
void | setStoreId(java.lang.Integer storeId)
Set the store ID.
|
void | setUom(java.lang.String uom)
Set the unit of measurement for the catalog entry.
|
protected java.lang.String[] | toRPN()
This method parses the expression into an array of characters which conform to the RPN algorithm.
|
void | validateParameters()
Checks mandatory parameters.
|
public static final java.lang.String COPYRIGHT
public static final java.lang.String CLASSNAME
public com.ibm.commerce.price.rule.runtime.objects.PriceEquationResultObject getPriceEquationResultObject()
public java.math.BigDecimal getInputPrice()
public java.lang.String getExpression()
public java.lang.String getCatentryId()
public java.lang.String getCurrency()
public java.lang.Integer getStoreId()
public java.lang.String getUom()
public java.lang.Double getQuantity()
public boolean getFlag()
public void setCatEntryId(java.lang.String catEntryId)
public void setCurrency(java.lang.String currency)
public void setEquationExpression(java.lang.String expression)
public void setInputPrice(java.math.BigDecimal inputPrice)
public void setQuantity(java.lang.Double quantity)
public void setStoreId(java.lang.Integer storeId)
public void setUom(java.lang.String uom)
public void setFlag(boolean flag)
public void setRuntimeParameters(java.util.Map runtimeParameters)
protected java.util.Map getRuntimeParametersMap()
public boolean isReadyToCallExecute()
public void performExecute() throws java.lang.Exception
protected com.ibm.commerce.price.rule.runtime.objects.PriceEquationResultObject calculatePriceEquation() throws java.lang.Exception
protected PriceEquationCalculationCmdImpl.Operand calculate(java.lang.String operator, PriceEquationCalculationCmdImpl.Operand operand1, PriceEquationCalculationCmdImpl.Operand operand2) throws java.lang.Exception
protected java.lang.String[] toRPN()
protected PriceEquationCalculationCmdImpl.Operand retrieveOperandValue(PriceEquationCalculationCmdImpl.Operand operand) throws ECException
protected PriceEquationCalculationCmdImpl.Operand getValueFromPriceList(java.lang.String token) throws ECException
protected PriceEquationCalculationCmdImpl.Operand getValueFromPriceConstant(java.lang.String token) throws ECException
protected java.lang.String resolveUomForAddOrSubtract(java.lang.String uom1, java.lang.String uom2) throws java.lang.Exception
protected java.lang.String resolveUomForDivide(java.lang.String uom1, java.lang.String uom2) throws java.lang.Exception
protected java.lang.String resolveUomForMultiply(java.lang.String uom1, java.lang.String uom2) throws java.lang.Exception
protected java.lang.String resolveEquationType(java.lang.String euqationUom)
protected java.lang.String resolveUniqueID(java.lang.String token)
public void validateParameters() throws ECException