T - type of real cart item.public abstract class AbstractRuleBase<T> extends java.lang.Object implements IRule<T>
IRule| Constructor and Description |
|---|
AbstractRuleBase() |
| Modifier and Type | Method and Description |
|---|---|
IRule<T> |
containsCountInc()
for
Calculator use only. |
double |
evalQuantity()
Quantity measure of bonus after
isTriggered(scpc.model.SingleItem) |
int |
getContainsCount()
符合此規則的品項數量
|
EvalHelper |
getEvalHelper()
A formula evaluator to help analysis.
|
IChainRule<T> |
getPrevious()
Previous rule.
|
java.lang.String |
getQuantityFormula()
When triggered, a formula to check how many quantities should offer.
|
int |
getSerialNum()
目前走訪商品之同品項物品的編號(從1起算)
|
java.math.BigDecimal |
getSumOfContainsRegularPrice()
符合此規則的品項原價小計
|
java.math.BigDecimal |
getSumOfContainsSalePrice()
符合此規則的品項售價小計
|
java.math.BigDecimal |
getSumOfSerialRegularPrice()
符合此規則的同品項原價小計
|
java.math.BigDecimal |
getSumOfSerialSalePrice()
符合此規則的同品項售價小計
|
java.lang.String |
getTriggerFormula()
A trigger formula is evaluated to determine whether to get a bonus or
not.
|
boolean |
isTriggered(SingleItem<T> item)
Determined iterable items if matched.
|
void |
resetSumOfPrice()
Reset sumary price to zero
重置所有價格累計為零 |
IRule<T> |
resetSumOfSerialRegularPrice()
Reset the summary regular price of the same applicable items.
|
IRule<T> |
resetSumOfSerialSalePrice()
Reset the summary sale price of the same applicable items.
|
IRule<T> |
serialNumInc(boolean doAdd) |
void |
setEvalHelper(EvalHelper evalHelper) |
void |
setPrevious(IChainRule<T> previousRule)
Set previous rule if exists.
|
void |
setQuantityFormula(java.lang.String quantityFormula)
Setting a formula to check how many quantities should offer after
triggered.
|
void |
setSerialSumOfSalePrice(java.math.BigDecimal serialSumOfSalePrice)
Setting the summary sale price of the same applicable items.
|
void |
setTriggerFormula(java.lang.String triggerFormula)
Setting a trigger formula is evaluated to determine whether to get a
bonus or not.
|
IRule<T> |
sumOfContainsRegularPriceInc(java.math.BigDecimal regularPrice)
Increase the summary regular price of applicable items.
|
IRule<T> |
sumOfContainsSalePriceInc(java.math.BigDecimal salePrice)
Increase the summary sale price of applicable items.
|
IRule<T> |
sumOfSerialRegularPriceInc(java.math.BigDecimal saleprice)
Increase the summary regular price of the same applicable items.
|
IRule<T> |
sumOfSerialSalePriceInc(java.math.BigDecimal saleprice)
Increase the summary sale price of the same applicable items.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontains, getPriceScale, getPriority, isLeafpublic AbstractRuleBase()
public java.lang.String getTriggerFormula()
public void setTriggerFormula(java.lang.String triggerFormula)
triggerFormula - public java.lang.String getQuantityFormula()
public void setQuantityFormula(java.lang.String quantityFormula)
quantityFormula - public IChainRule<T> getPrevious()
IRulegetPrevious in interface IRule<T>IRule.getPrevious()public void setPrevious(IChainRule<T> previousRule)
previousRule - previous rulepublic IRule<T> containsCountInc()
Calculator use only.containsCountInc in interface IRule<T>public int getContainsCount()
IRulegetContainsCount in interface IRule<T>IRule.getContainsCount()public IRule<T> serialNumInc(boolean doAdd)
serialNumInc in interface IRule<T>doAdd - IRule.serialNumInc(boolean)public int getSerialNum()
IRulegetSerialNum in interface IRule<T>IRule.getSerialNum()public IRule<T> sumOfContainsRegularPriceInc(java.math.BigDecimal regularPrice)
IRulesumOfContainsRegularPriceInc in interface IRule<T>regularPrice - IRule.sumOfContainsRegularPriceInc(java.math.BigDecimal)public IRule<T> sumOfContainsSalePriceInc(java.math.BigDecimal salePrice)
IRulesumOfContainsSalePriceInc in interface IRule<T>salePrice - IRule.sumOfContainsSalePriceInc(java.math.BigDecimal)public java.math.BigDecimal getSumOfContainsRegularPrice()
IRulegetSumOfContainsRegularPrice in interface IRule<T>IRule.getSumOfContainsRegularPrice()public java.math.BigDecimal getSumOfContainsSalePrice()
IRulegetSumOfContainsSalePrice in interface IRule<T>IRule.getSumOfContainsSalePrice()public java.math.BigDecimal getSumOfSerialRegularPrice()
IRulegetSumOfSerialRegularPrice in interface IRule<T>IRule.getSumOfSerialRegularPrice()public java.math.BigDecimal getSumOfSerialSalePrice()
IRulegetSumOfSerialSalePrice in interface IRule<T>IRule.getSumOfSerialSalePrice()public void setSerialSumOfSalePrice(java.math.BigDecimal serialSumOfSalePrice)
serialSumOfSalePrice - public IRule<T> sumOfSerialRegularPriceInc(java.math.BigDecimal saleprice)
IRulesumOfSerialRegularPriceInc in interface IRule<T>saleprice - IRule.sumOfSerialRegularPriceInc(java.math.BigDecimal)public IRule<T> sumOfSerialSalePriceInc(java.math.BigDecimal saleprice)
IRulesumOfSerialSalePriceInc in interface IRule<T>saleprice - IRule.sumOfSerialSalePriceInc(java.math.BigDecimal)public IRule<T> resetSumOfSerialRegularPrice()
IRuleresetSumOfSerialRegularPrice in interface IRule<T>IRule.resetSumOfSerialRegularPrice()public IRule<T> resetSumOfSerialSalePrice()
IRuleresetSumOfSerialSalePrice in interface IRule<T>IRule.resetSumOfSerialSalePrice()public void resetSumOfPrice()
IRuleresetSumOfPrice in interface IRule<T>public EvalHelper getEvalHelper()
public void setEvalHelper(EvalHelper evalHelper)
public boolean isTriggered(SingleItem<T> item) throws javax.script.ScriptException
IRuleisTriggered in interface IRule<T>item - javax.script.ScriptExceptionIRule.isTriggered(scpc.model.SingleItem)public double evalQuantity() throws javax.script.ScriptException
isTriggered(scpc.model.SingleItem).
* javax.script.ScriptExceptionCopyright © 2019. All rights reserved.