47 lines
949 B
Java
47 lines
949 B
Java
package com.xgiovio;
|
|
|
|
import arraylist.ArrayIndexList;
|
|
import com.xgiovio.general_utility.test_object;
|
|
|
|
import java.util.Iterator;
|
|
|
|
/**
|
|
* Created with xgiovio.macbookair.
|
|
* User: xgiovio
|
|
* Date: 23/03/14
|
|
* Time: 20:37
|
|
*/
|
|
public class ArrayIndexListTest {
|
|
|
|
public static void main(String[] args) {
|
|
ArrayIndexList<test_object> a = new ArrayIndexList<test_object>(2);
|
|
|
|
a.add(0,new test_object(1));
|
|
a.add(1,new test_object(2));
|
|
a.add(2,new test_object(3));
|
|
a.add(3,new test_object(4));
|
|
|
|
System.out.print(a);
|
|
a.remove(2);
|
|
System.out.print(a);
|
|
|
|
|
|
Iterator<test_object> it = a.iterator();
|
|
System.out.print(it.hasNext());
|
|
System.out.print(it.next());
|
|
System.out.print(it.hasNext());
|
|
System.out.print(it.next());
|
|
System.out.print(it.hasNext());
|
|
System.out.print(it.next());
|
|
System.out.print(it.hasNext());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|