Rimosso ArraySequenceFake. Implementato positions() in NodePositionList. Creato il DefaultComparator. Prima implementazione di SortedPriorityList
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
package com.xgiovio;
|
||||
|
||||
import general_utility.test_object;
|
||||
import position.Position;
|
||||
import sequence.ArraySequenceFake;
|
||||
|
||||
/**
|
||||
* Created with xgiovio.macbookair.
|
||||
* User: xgiovio
|
||||
* Date: 23/03/14
|
||||
* Time: 20:37
|
||||
*/
|
||||
public class ArraySequenceFakeTest {
|
||||
|
||||
public static void main(String[] args) {
|
||||
ArraySequenceFake<test_object> a = new ArraySequenceFake<test_object>(10);
|
||||
|
||||
a.addFirst(new test_object(3));
|
||||
Position<test_object> p = a.addAfter(a.first(), new test_object(6));
|
||||
System.out.print(a);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.xgiovio;
|
||||
import arraylist.ArrayIndexList;
|
||||
import general_utility.test_object;
|
||||
import position.NodePositionList;
|
||||
import position.Position;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
@@ -38,6 +39,18 @@ public class NodePositionListTest {
|
||||
System.out.print(it.next());
|
||||
System.out.print(it.hasNext());
|
||||
|
||||
Iterator<Position<test_object>> itp = a.positions();
|
||||
System.out.print(itp.hasNext());
|
||||
System.out.print(itp.next().element());
|
||||
System.out.print(itp.hasNext());
|
||||
System.out.print(itp.next().element());
|
||||
System.out.print(itp.hasNext());
|
||||
System.out.print(itp.next().element());
|
||||
System.out.print(itp.hasNext());
|
||||
System.out.print(itp.next().element());
|
||||
System.out.print(itp.hasNext());
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user