Class AmountablePriceDouble


  • public class AmountablePriceDouble
    extends java.lang.Object
    This amountable keeps track of the amounts in a more detailed fashion than AmountablePrice. It is only intended for internal use.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2017 Created on Oct 08, 2017
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(double amount, double avgPrice)
      Add a number items
      double getAmount()  
      int getAVGPrice()
      Retrieve the average price of one item
      double getAVGPriceExact()  
      void remove​(double amount)
      Remove a number of items
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AmountablePriceDouble

        public AmountablePriceDouble()
    • 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 added
        avgPrice - 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