Class AmountablePriceDouble
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.product.AmountablePriceDouble
-
public class AmountablePriceDouble extends java.lang.ObjectThis amountable keeps track of the amounts in a more detailed fashion thanAmountablePrice. It is only intended for internal use.- Author:
- Andi Hotz, (c) Sahits GmbH, 2017 Created on Oct 08, 2017
-
-
Constructor Summary
Constructors Constructor Description AmountablePriceDouble()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(double amount, double avgPrice)Add a number itemsdoublegetAmount()intgetAVGPrice()Retrieve the average price of one itemdoublegetAVGPriceExact()voidremove(double amount)Remove a number of items
-
-
-
Method Detail
-
getAmount
public double getAmount()
-
getAVGPrice
public int getAVGPrice()
Retrieve the average price of one item- Returns:
- average price of one item.
-
getAVGPriceExact
public double getAVGPriceExact()
-
add
public void add(double amount, double avgPrice)Add a number items- Parameters:
amount- number of the items to be addedavgPrice- average price of one item that is added
-
remove
public void remove(double amount)
Remove a number of items- Parameters:
amount- of items to be removed
-
-