T - IAmountable implementation that is is collected hereby called itempublic class AmountablePrice<T extends IAmountable> extends BaseAmountable<T>
IWare object.
Each object in the real world has hits unique price. Since no instances of the
objects are used but only one reference the price information gets lost. The
amountable price tracks the average price of all amounted objectsfxTheadExecution| Constructor | Description |
|---|---|
AmountablePrice() |
|
AmountablePrice(int amount,
double totalPrice) |
Constructor initalizing the amountablePrice with an amount and average price.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
add(int amount,
int avgPrice) |
Add a number items
|
javafx.beans.binding.NumberBinding |
avgPriceProperty() |
|
boolean |
equals(java.lang.Object o) |
|
int |
getAVGPrice() |
Retrieve the average price of one item
|
double |
getSum() |
Get the total cum of the amount.
|
int |
hashCode() |
|
void |
remove(int amount) |
Remove a number of items
|
void |
reset() |
Set the amount to 0.
|
java.lang.String |
toString() |
add, amountProperty, getAmount, setAmountpublic AmountablePrice()
public AmountablePrice(int amount,
double totalPrice)
amount - represented by this.totalPrice - total price of the complete amountpublic int getAVGPrice()
public javafx.beans.binding.NumberBinding avgPriceProperty()
public void add(int amount,
int avgPrice)
amount - number of the items to be addedavgPrice - average price of one item that is addedpublic void remove(int amount)
remove in class BaseAmountable<T extends IAmountable>amount - of items to be removedpublic void reset()
BaseAmountablereset in class BaseAmountable<T extends IAmountable>public java.lang.String toString()
toString in class BaseAmountable<T extends IAmountable>public boolean equals(java.lang.Object o)
equals in class BaseAmountable<T extends IAmountable>public int hashCode()
hashCode in class BaseAmountable<T extends IAmountable>public double getSum()
Copyright © 2011-2018 Sahits GmbH. All Rights Reserved.