MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / testVisual

Method testVisual

collectiontopics/ListOps.java:69–93  ·  view source on GitHub ↗
(List<String> a)

Source from the content-addressed store, hash-verified

67 it.set("47");
68 }
69 public static void testVisual(List<String> a) {
70 System.out.println(a);
71 List<String> b = LIST;
72 System.out.println("b = " + b);
73 a.addAll(b);
74 a.addAll(b);
75 System.out.println(a);
76 // Insert, remove, and replace elements
77 // using a ListIterator:
78 ListIterator<String> x =
79 a.listIterator(a.size()/2);
80 x.add("one");
81 System.out.println(a);
82 System.out.println(x.next());
83 x.remove();
84 System.out.println(x.next());
85 x.set("47");
86 System.out.println(a);
87 // Traverse the list backwards:
88 x = a.listIterator(a.size());
89 while(x.hasPrevious())
90 System.out.print(x.previous() + " ");
91 System.out.println();
92 System.out.println("testVisual finished");
93 }
94 // There are some things that only LinkedLists can do:
95 public static void testLinkedList() {
96 LinkedList<String> ll = new LinkedList<>();

Callers 1

mainMethod · 0.95

Calls 7

addAllMethod · 0.80
printMethod · 0.80
nextMethod · 0.65
setMethod · 0.65
sizeMethod · 0.45
addMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected