70 lines
1.2 KiB
Java
70 lines
1.2 KiB
Java
package com.xgiovio;
|
|
|
|
import com.xgiovio.general_utility.test_object;
|
|
import sequence.NodeSequence;
|
|
import com.xgiovio.esercizi.*;
|
|
|
|
/**
|
|
* Created with xgiovio.macbookair.
|
|
* User: xgiovio
|
|
* Date: 23/03/14
|
|
* Time: 20:37
|
|
*/
|
|
public class NodeSequenceTest {
|
|
|
|
public static void main(String[] args) {
|
|
NodeSequence<test_object> a = new NodeSequence<test_object>();
|
|
|
|
System.out.print(a);
|
|
|
|
a.add(0,new test_object(1));
|
|
|
|
System.out.print(a);
|
|
|
|
a.add(1,new test_object(2));
|
|
|
|
|
|
System.out.print(a);
|
|
|
|
a.add(2,new test_object(3));
|
|
System.out.print(a);
|
|
a.add(3,new test_object(4));
|
|
|
|
System.out.print(a);
|
|
a.remove(2);
|
|
System.out.print(a);
|
|
|
|
a.add(0,new test_object(4));
|
|
|
|
System.out.print(a);
|
|
a.add(3,new test_object(10));
|
|
|
|
System.out.print(a);
|
|
a.add(4,new test_object(11));
|
|
|
|
System.out.print(a);
|
|
a.add(6,new test_object(100));
|
|
|
|
System.out.print(a);
|
|
|
|
a.set(0,new test_object(100));
|
|
|
|
System.out.print(a);
|
|
a.set(6,new test_object(200));
|
|
|
|
System.out.print(a);
|
|
static_methods.reverse(a);
|
|
|
|
System.out.print(a);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|