psoft.hsphere.promotion.calc
Class PercentDiscountCalc
java.lang.Object
|
+--psoft.hsphere.promotion.AbstractPromoDataStorage
|
+--psoft.hsphere.promotion.calc.PercentDiscountCalc
- All Implemented Interfaces:
- PromoCalculator
- public class PercentDiscountCalc
- extends AbstractPromoDataStorage
- implements PromoCalculator
|
Method Summary |
int |
getDataType()
|
double |
getPromoDiscount(psoft.hsphere.Account a,
double sum)
Calculates discount for passed sum |
void |
updateData(long promoId,
java.util.Hashtable data)
Updates calculator object and saves the data needed by the
calculator to the H-SPhere database |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PercentDiscountCalc
public PercentDiscountCalc(long promoId)
throws java.lang.Exception
PercentDiscountCalc
public PercentDiscountCalc(long promoId,
java.util.Hashtable data)
throws java.lang.Exception
getDataType
public int getDataType()
- Specified by:
getDataType in class AbstractPromoDataStorage
getPromoDiscount
public double getPromoDiscount(psoft.hsphere.Account a,
double sum)
- Description copied from interface:
PromoCalculator
- Calculates discount for passed sum
- Specified by:
getPromoDiscount in interface PromoCalculator
- Parameters:
a - Account for which discount is being calculatedsum - Full amount of charge
- Returns:
- double
updateData
public void updateData(long promoId,
java.util.Hashtable data)
throws java.lang.Exception
- Description copied from interface:
PromoCalculator
- Updates calculator object and saves the data needed by the
calculator to the H-SPhere database
- Specified by:
updateData in interface PromoCalculator- Overrides:
updateData in class AbstractPromoDataStorage
- Parameters:
promoId - id of the Promo objectdata - name/value pairs of data
- Throws:
java.lang.Exception