Class ItemManager


  • public class ItemManager
    extends java.lang.Object

    ItemManager

    Responsible for handling all the functionality needed for the items.
    Since:
    2017-07-17
    Version:
    1.0
    • Constructor Summary

      Constructors 
      Constructor Description
      ItemManager()  
    • Method Summary

      Modifier and Type Method Description
      int addItem​(Item anItem)
      Adds an item in the list
      java.util.ArrayList<Item> getAllItems()  
      Item getItem​(int index)
      Retrieves an item from a selected position
      int removeItem​(int index)
      Removes an item from the list
      java.lang.String reportAllItems()
      Displays all the information for each item in the console
      • Methods inherited from class java.lang.Object

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

      • ItemManager

        public ItemManager()
    • Method Detail

      • addItem

        public int addItem​(Item anItem)
        Adds an item in the list
        Parameters:
        an - Item to be added to the products for sale
        Returns:
        an int with the size of the items' list
      • removeItem

        public int removeItem​(int index)
        Removes an item from the list
        Returns:
        an int with the size of the items' list
      • getItem

        public Item getItem​(int index)
        Retrieves an item from a selected position
        Parameters:
        index - : position of the item to be retrieved
        Returns:
        an item from the list
      • getAllItems

        public java.util.ArrayList<Item> getAllItems()
        Returns:
        the list holding the item
      • reportAllItems

        public java.lang.String reportAllItems()
        Displays all the information for each item in the console