2 import java
.util
.ListIterator
;
4 public class ListExtension
<E
> {
7 public ListExtension() {
11 public ListExtension(List
<E
> l
) {
16 * [setList description]
17 * @param l [description]
19 public void setList(List
<E
> l
) {
24 * [getList description]
25 * @return [description]
27 public List
<E
> getList() {
31 public boolean add(E e
) {
40 * Should mimic the List<E> add(int index, T value) method
41 * @param value [description]
42 * @return [description]
44 public void addIter(int index
, E value
) {
45 ListIterator
<E
> iter
= list
.listIterator();
47 // go to the element at index + 1
48 while (iter
.hasNext() && i
<= index
) {
55 //FIXME: replace parameter by the list of objects to add
56 public void addNelements(int index
, int Nelements
) {
57 ListIterator
<E
> iter
= list
.listIterator();
59 // go to the element at index + 1
60 while (iter
.hasNext() && i
<= index
) {
64 for (int j
= 0; j
< Nelements
; j
++) {
65 iter
.add((E
)new Object());