
// Database.java
// Andrew Davison, Nov 2018, ad@fivedots.coe.psu.ac.th


/**
 * The database class provides a facility to store entertainment
 * item objects. A list of all items can be printed to the
 * terminal.
 * 
 * This version does not save the data to disk, and it does not
 * provide any search functions.
 * 
 * @author Michael Kolling and David J. Barnes
 * @version 2006.03.30
 */


import java.util.ArrayList;


public class Database
{
  private ArrayList<Item> items;


  public Database()
  {  items = new ArrayList<Item>();  }


  public void addItem(Item theItem)
  {  items.add(theItem);  }


  public void list()
  // print a list of all currently stored items
  {  
    for (Item item : items)
      item.print();
  }  // end of list()

}  // end of Database class
