/* * MyList.java * * Created on November 25, 2004, 5:13 PM */ /** * * @author levenick */ public class MyIntArrayList { private static int MAX_VALUE = 10000; int [] list; int last; // where is the last thing in this list /** Creates a new instance of List */ public MyIntArrayList() { list = new int[MAX_VALUE]; last = -1; } public int elementAt(int i) { return list[i]; } public void replaceElementAt(int nuValue, int i) { list[i] = nuValue; } public void removeElementAt(int removalIndex) { for (int i=removalIndex; i=putHereIndex; i--) list[i+1] = list[i]; list[putHereIndex] = insertMe; last++; } public void addElement(int nu) { list[++last] = nu; } public int length() { return last+1; } public void makeEmpty() { last = -1; } public String toString() { String returnMe="{"; for (int i=0; i