65 lines
1.1 KiB
Java
65 lines
1.1 KiB
Java
package arraylist;
|
|
|
|
/**
|
|
* Created with xgiovio.macbookair.
|
|
* User: xgiovio
|
|
* Date: 24/03/14
|
|
* Time: 14:31
|
|
*/
|
|
public class ArrayIndexList<E> implements IndexList<E> {
|
|
|
|
|
|
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;
|
|
|
|
}
|