/**
 * CS1101 Lab 04 Ex 1: MyArrayList.java
 *
 * <fill in your discussion group here>
 *
 * This class stores an item into a list.
 **/

import java.util.*;

public class MyArrayList
{
    private ListItem[] container;
    private int size = 0;

    /*
     * Constructs an empty list with an initial capacity of ten.
     */
    public MyArrayList()
    {
        container = new ListItem[10];
    }

    /*
     * Constructs a list containing the elements of the specified array.
     */
    public MyArrayList(MyArrayList list)
    {

    }

    /*
     *  Constructs an empty list with the specified initial capacity.
     */
    public MyArrayList(int capacity)
    {

    }

    /*
     *  Inserts the specified element at the specified position in this list.
     */
    public void add(int index, ListItem elem)
    {

    }

    private void resize(int newSize)
    {

    }

    /*
     *  Appends the specified element to the end of this list.
     */
    public void add(ListItem elem)
    {

    }

    /*
     * Appends all of the elements in the specified Array to 
     * the end of this list in the same order
     */
    public void addAll(MyArrayList list)
    {

    }

    /*
     * Inserts all of the elements in the specified Array into this list, 
     * starting at the specified position.
     */
    public void addAll(int index, MyArrayList list)
    {

    }

    /*
     * Removes all of the elements from this list.
     */
    public void clear()
    {

    }

    /*
     * Returns a copy of this MyArrayList instance.
     */
    public MyArrayList clone()
    {
        return null;
    }

    /*
     * Returns true if this list contains the specified element.
     */
    public boolean contains(ListItem elem)
    {
        return false;
    }

    /*
     * Returns the element at the specified position in this list.
     */
    public ListItem get(int index)
    {
        return null;
    }

    /*
     * Searches for the first occurence of the given argument, 
     * testing for equality using the equals method.
     */
    public int indexOf(ListItem elem)
    {
        return -1;
    }

    /*
     * Tests if this list has no element.
     */
    public boolean isEmpty()
    {
        return false;
    }

    /*
     * Returns the index of the last occurrence of the specified object 
     * in this list.
     */
    public int lastIndexOf(ListItem elem)
    {
        return -1;
    }

    /*
     * Removes the element at the specified position in this list.
     * Returns the element previously at the specified position.
     */
    public ListItem remove(int index)
    {
        return null;
    }

    /*
     * Replaces the element at the specified position in this list 
     * with the specified element.
     * Returns the element previously at the specified position.
     */
    public ListItem set(int index, ListItem elem)
    {
        return null;
    }

    /*
     * Returns the number of elements in this list.
     */
    public int size()
    {
        return -1;
    }

    /*
     *  ***** DO NOT CHANGE THIS METHOD *****
     */
    public String toString()
    {
        String temp = "[";
        for (int i = 0; i < size - 1; i++)
        {
            temp += get(i).toString() + ",";
        }
        if (!isEmpty())
            temp += get(size-1).toString();
        temp += "]";
        return temp;
    }
}

