@Override
public boolean isEmpty() {
return length == 0;
}
@Override
public int length() {
System.out.println("length = "+length);
return length;
}
@Override
public T get(int index) {
if (!checkBounds(index)) {
throw new ArrayIndexOutOfBoundsException(checkBoundsMsg(index));
}
Node<T> pointer = getElement(index);
return pointer.item;
}
@Override
public boolean add(int index, T t) {
if (!checkBounds(index)) {
throw new ArrayIndexOutOfBoundsException(checkBoundsMsg(index));
}
System.out.println("add "+index+" "+t.toString());