diff --git a/.DS_Store b/.DS_Store index 5008ddf..5c9fb53 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/arraylist/ArrayIndexList.java b/arraylist/ArrayIndexList.java new file mode 100644 index 0000000..27e6400 --- /dev/null +++ b/arraylist/ArrayIndexList.java @@ -0,0 +1,64 @@ +package arraylist; + +/** + * Created with xgiovio.macbookair. + * User: xgiovio + * Date: 24/03/14 + * Time: 14:31 + */ +public class ArrayIndexList implements IndexList { + + + public ArrayIndexList(){ + indexlist = (E[])new Object [def_capacity]; + } + + public ArrayIndexList( int in_n){ + indexlist = (E[])new Object [in_n]; + } + + + @Override + public E remove(int i) throws IndexOutOfBoundsException { + return null; + } + + @Override + public void add(int i, E e) throws IndexOutOfBoundsException { + + } + + @Override + public E set(int i, E e) throws IndexOutOfBoundsException { + return null; + } + + @Override + public E get(int i) throws IndexOutOfBoundsException { + return null; + } + + @Override + public boolean isEmpty() { + if (size() == 0){ + return true; + }else{ + return false; + } + } + + @Override + public int size() { + return nelements; + } + + @Override + public String toString() { + return super.toString(); + } + + private E[] indexlist; + private int def_capacity = 100; + private int nelements = 0; + +} diff --git a/arraylist/IndexList.java b/arraylist/IndexList.java new file mode 100644 index 0000000..247c9ec --- /dev/null +++ b/arraylist/IndexList.java @@ -0,0 +1,20 @@ +package arraylist; + +/** + * Created with xgiovio.macbookair. + * User: xgiovio + * Date: 24/03/14 + * Time: 14:29 + */ +public interface IndexList { + + + public E remove(int i) throws IndexOutOfBoundsException; + public void add(int i, E e) throws IndexOutOfBoundsException; + public E set(int i, E e) throws IndexOutOfBoundsException; + public E get(int i) throws IndexOutOfBoundsException; + public boolean isEmpty(); + public int size(); + + +}