Package bookstoreAcceptable
Class ItemManager
- java.lang.Object
-
- bookstoreAcceptable.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 listjava.util.ArrayList<Item>
getAllItems()
Item
getItem(int index)
Retrieves an item from a selected positionint
removeItem(int index)
Removes an item from the listjava.lang.String
reportAllItems()
Displays all the information for each item in the console
-
-
-
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
-
-