/* * MyIntArrayList.java * * Created on April 12, 2005, 10:21 PM */ package sorttimer; /** * * @author levenick */ public class MyIntArrayList implements IntList { private static int MAX_SIZE = 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_SIZE]; last = -1; } public int elementAt(int i) { return list[i]; } public void replaceElementAt(int nuValue, int i) { list[i] = nuValue; } public void deleteElementAt(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