import java.util.List;
import java.util.ListIterator;
+import java.util.AbstractList;
-public class ListExtension<E> {
+public class ListExtension<E> extends AbstractList<E> {
private List<E> list;
public ListExtension() {
return list;
}
- public boolean add(E e) {
- return list.add(e);
+ /**
+ * [get description]
+ * @param index [description]
+ * @return [description]
+ */
+ public E get(int index) {
+ return list.get(index);
}
+ /**
+ * [size description]
+ * @return [description]
+ */
public int size() {
return list.size();
}
+ public boolean add(E e) {
+ return list.add(e);
+ }
+
/**
* Should mimic the List<E> add(int index, E value) method
* @param index [description]
* @param value [description]
* @return [description]
*/
- public void addIter(int index, E value) {
+ public void add(int index, E value) {
ListIterator<E> iter = list.listIterator();
int i = 0;
// go to the element at index + 1
long startTime = System.nanoTime();
// for (int i = 0; i < 100000; i++) {
- // array.addIter(array.size() / 2, i);
+ // array.add(array.size() / 2, i);
// }
array.addNelements(array.size() / 2, 100000);
long stopTime = System.nanoTime();
startTime = System.nanoTime();
// for (int i = 0; i < 100000; i++) {
- // list.addIter(list.size() / 2, i);
+ // list.add(list.size() / 2, i);
// }
list.addNelements(list.size() / 2, 100000);
stopTime = System.nanoTime();