import java.awt.*;
import java.util.*;

/**
 * Using our first collection - ArrayList
 * 
 * 1) Show the basics
 * 2) Try out: clear, remove, contains, and indexOf
 * 3) Go back to lecture to show boxing
 * 
 * @author McKinley
 * @version April 2007
 */
public class Inventory
{

    public static void main (String [] args)
    {   
        ArrayList<Items> apples = new ArrayList<Items>();
        Items a = new Items ("Ruby Red", 109);
        apples.add(a);
        a = new Items ("McIntosh", 8);
        apples.add(a);
        a = new Items ("Gala", 88);
        apples.add(0, a);
        
        System.out.println();
        for (int i = 0; i < apples.size(); i++) {
            System.out.println(apples.get(i));            
        }
        
        /* Short hand for same iterating through an ArrayList
         * 
         * for (<type> <variable name> : <ArrayList name>) {
         *    <statement> 
         *    ....
         *    <statement>
         * }

         for (Items item: apples) {
             System.out.println(item);
         }

         * 
         */         
        
        
        
/*        ArrayList<Integer> amounts = new ArrayList<Integer>();
        Integer box = new Integer(1);
        amounts.add(box);
        amounts.add(10);   //automatically boxed and unboxed
        amounts.add(1000);
        amounts.add(101);
        for (int i = 0; i < amounts.size(); i++) {
            System.out.println(amounts.get(i));
        }
*/
    }

}
