This class is based on Peter Coad's Components from Java Modeling in Color with UML
Stereotype: |
moment-interval |
|
Version: |
1.0 07/31/99 |
|
Author: |
TogetherSoft |
|
See Also: |
ProductDesc |
|
persistent |
Field Summary |
||
private Date |
notValidAfter Used as the end of the applicable interval for determining if price is valid. |
|
private BigDecimal |
price This is the meat of this class...the price |
|
static final int |
PRICE_INVALID_STATUS Public constant to define an invalid price status |
|
static final int |
PRICE_VALID_STATUS Public constant to define a valid price status |
|
private int |
priceQty The quantity that this price is valid for. |
|
private int |
priceUOM The unit of measure that this price is for. |
|
private int |
status Status of price |
|
private Date |
validStarting Used as the start of the applicable interval for determining if price is valid. |
Constructor Summary |
||
ProductPrice(Date start) |
Method Summary |
||
BigDecimal |
calcPriceForQty(int q) |
|
Date |
||
BigDecimal |
getPrice() |
|
int |
||
int |
||
int |
||
Date |
||
boolean |
||
void |
||
void |
setNotValidAfter(Date nva) |
|
void |
setPrice(BigDecimal aPrice) |
|
void |
setPriceQty(int aPriceQty) |
|
void |
setPriceUOM(int aPriceUOM) |
|
void |
setStatus(int aStatus) |
|
void |
setValidStarting(Date aValidStarting) |
See Also: |
+isValidOnDate() |
rdbLogicalType: |
DATE |
See Also: |
+isValidOnDate() |
rdbLogicalType: |
DATE |
rdbLogicalType: |
NUMERIC |
This could be used as a quantity discount differentiator if pricing algorithm accounted for the possible existence of more than one price per valid interval. However, it would be better to model this "feature" explicitly!
rdbLogicalType: |
INTEGER |
In reality, this is generally a completely separate class that would include things like conversion factors between UOMs.
rdbLogicalType: |
INTEGER |
rdbLogicalType: |
INTEGER |
Price is valid if date being checked is greater than or equal to Starting and not greater than ValidAfter date.
Returns: |
True if date is within applicable interval else false. |