T - type of real cart item.public interface IRule<T>
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(IItem<T> item)
Detecting item whether is applicable to this rule or not.
|
IRule<T> |
containsCountInc()
Increase one count of items that is applicable to this rule.
|
int |
getContainsCount()
符合此規則的品項數量
|
IChainRule<T> |
getPrevious()
Previous rule.
|
int |
getPriceScale()
價格精度
|
int |
getPriority()
Priority, the smaller the value the higher the priority.
|
int |
getSerialNum()
目前走訪商品之同品項物品的編號(從1起算)
|
java.math.BigDecimal |
getSumOfContainsOriginalPrice()
符合此規則的品項原價小計
|
java.math.BigDecimal |
getSumOfContainsSalePrice()
符合此規則的品項售價小計
|
java.math.BigDecimal |
getSumOfSerialOriginalPrice()
符合此規則的同品項原價小計
|
java.math.BigDecimal |
getSumOfSerialSalePrice()
符合此規則的同品項售價小計
|
boolean |
isLeaf()
Whether this rule is a leaf rule or not.
|
boolean |
isTriggered(SingleItem<T> item)
Determined iterable items if matched.
|
void |
resetSumOfPrice()
Reset sumary price to zero
重置所有價格累計為零 |
IRule<T> |
resetSumOfSerialOriginalPrice()
Reset the summary original price of the same applicable items.
|
IRule<T> |
resetSumOfSerialSalePrice()
Reset the summary sale price of the same applicable items.
|
IRule<T> |
serialNumInc(boolean doAdd) |
IRule<T> |
sumOfContainsOriginalPriceInc(java.math.BigDecimal salePrice)
Increase the summary original price of applicable items.
|
IRule<T> |
sumOfContainsSalePriceInc(java.math.BigDecimal salePrice)
Increase the summary sale price of applicable items.
|
IRule<T> |
sumOfSerialOriginalPriceInc(java.math.BigDecimal oriprice)
Increase the summary oringal price of the same applicable items.
|
IRule<T> |
sumOfSerialSalePriceInc(java.math.BigDecimal saleprice)
Increase the summary sale price of the same applicable items.
|
int getPriority()
boolean contains(IItem<T> item)
item - object in shopping cart.boolean isTriggered(SingleItem<T> item) throws javax.script.ScriptException
item - cart itemjavax.script.ScriptExceptionboolean isLeaf()
IChainRule<T> getPrevious()
int getPriceScale()
IRule<T> containsCountInc()
int getContainsCount()
IRule<T> serialNumInc(boolean doAdd)
doAdd - true to add one to the serial number otherwise reset serial number to one.int getSerialNum()
IRule<T> sumOfContainsSalePriceInc(java.math.BigDecimal salePrice)
salePrice - java.math.BigDecimal getSumOfContainsSalePrice()
IRule<T> sumOfContainsOriginalPriceInc(java.math.BigDecimal salePrice)
salePrice - java.math.BigDecimal getSumOfContainsOriginalPrice()
IRule<T> sumOfSerialSalePriceInc(java.math.BigDecimal saleprice)
saleprice - java.math.BigDecimal getSumOfSerialSalePrice()
IRule<T> resetSumOfSerialSalePrice()
IRule<T> sumOfSerialOriginalPriceInc(java.math.BigDecimal oriprice)
oriprice - original pricejava.math.BigDecimal getSumOfSerialOriginalPrice()
IRule<T> resetSumOfSerialOriginalPrice()
void resetSumOfPrice()
Copyright © 2018. All rights reserved.