modificato arraysequence in fake e aggiunti una nuova versione. fidato alcuni metodi che restituivano void invece di position. sono necessari ulteriori test
This commit is contained in:
25
com/xgiovio/ArraySequenceFakeTest.java
Normal file
25
com/xgiovio/ArraySequenceFakeTest.java
Normal file
@@ -0,0 +1,25 @@
|
||||
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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
package com.xgiovio;
|
||||
|
||||
import arraylist.ArrayIndexList;
|
||||
import general_utility.test_object;
|
||||
import position.Position;
|
||||
import sequence.ArraySequence;
|
||||
import sequence.NodeSequence;
|
||||
import sequence.ArraySequenceFake;
|
||||
|
||||
/**
|
||||
* Created with xgiovio.macbookair.
|
||||
@@ -17,43 +16,9 @@ public class ArraySequenceTest {
|
||||
public static void main(String[] args) {
|
||||
ArraySequence<test_object> a = new ArraySequence<test_object>(10);
|
||||
|
||||
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));
|
||||
|
||||
a.addFirst(new test_object(3));
|
||||
Position<test_object> p = a.addAfter(a.first(), new test_object(6));
|
||||
System.out.print(a);
|
||||
a.remove(2);
|
||||
System.out.print(a);
|
||||
System.out.print(a.first().element());
|
||||
System.out.print(a.last().element());
|
||||
a.addLast(new test_object(1000));
|
||||
System.out.print(a);
|
||||
a.addFirst(new test_object(2000));
|
||||
System.out.print(a);
|
||||
a.add(0,new test_object(1));
|
||||
System.out.print(a);
|
||||
a.add(5,new test_object(5));
|
||||
System.out.print(a);
|
||||
a.add(6,new test_object(125));
|
||||
System.out.print(a);
|
||||
a.add(8,new test_object(211));
|
||||
System.out.print(a);
|
||||
a.set(0, new test_object(211));
|
||||
System.out.print(a);
|
||||
a.set(1,new test_object(211));
|
||||
System.out.print(a);
|
||||
|
||||
|
||||
global.reverse(a);
|
||||
|
||||
System.out.print(a);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user