Class ProductionStorage


  • public class ProductionStorage
    extends java.lang.Object
    This is the local storage for the production workshops.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2016 Created on May 14, 2016
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getAvgPrice​(IWare ware)
      Retrieve the average price of the stored amount.
      double getStored​(IWare ware)
      Retrieve the amount that is stored of a specific ware.
      double transfer​(IWare ware, double amount, double avgPrice)
      Transfer wares to/from the storage.
      • Methods inherited from class java.lang.Object

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

      • ProductionStorage

        public ProductionStorage()
    • Method Detail

      • getStored

        public double getStored​(IWare ware)
        Retrieve the amount that is stored of a specific ware.
        Parameters:
        ware - for whicht to retrieve the stored amount
        Returns:
        stored amount of ware
      • getAvgPrice

        public double getAvgPrice​(IWare ware)
        Retrieve the average price of the stored amount.
        Parameters:
        ware - for which the price is to be looked up
        Returns:
        average price or 0, if the ware is not available.
      • transfer

        public double transfer​(IWare ware,
                               double amount,
                               double avgPrice)
        Transfer wares to/from the storage. Negative amount values mean withdrawing from the storage.
        Parameters:
        ware - that is to be transfered
        amount - to be moved
        avgPrice - of the ware
        Returns:
        the amount that was actually transfered