|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.geebis.books.model.item.Item
org.geebis.books.model.item.nonretail.NonRetailItem
org.geebis.books.model.item.nonretail.Discount
@Name(value="discount") public class Discount
The Discount class represents an item that is a discount
The default percent is 0
Discounts are represented internally as percents, ie 10% is 10
Discounts greater than 100 are used to represent markups of (percent - 100)%
| Constructor Summary | |
|---|---|
Discount()
|
|
Discount(java.lang.String name)
|
|
Discount(java.lang.String name,
java.lang.Double percent)
|
|
| Method Summary | |
|---|---|
double |
applyDiscount(double value)
Returns the amount of the value after a discount is calculated |
double |
calculateDiscountAmount(double value)
Calculates the amount of discount that this discount would give if applied to the given value |
java.lang.Double |
getPercent()
Gets the percent of this discount |
void |
setPercent(java.lang.Double percent)
Sets the percent of this discount |
| Methods inherited from class org.geebis.books.model.item.Item |
|---|
getDescription, getId, getName, getSalesAccount, getVersion, setDescription, setId, setName, setSalesAccount, setVersion |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Discount()
public Discount(java.lang.String name)
public Discount(java.lang.String name,
java.lang.Double percent)
| Method Detail |
|---|
public java.lang.Double getPercent()
public void setPercent(java.lang.Double percent)
percent - the new percent for this discountpublic double applyDiscount(double value)
value - the value to calculate the discount amount off of
public double calculateDiscountAmount(double value)
value - the value to calculate the discount amount off of
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||