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

Method iterManipulation

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

Source from the content-addressed store, hash-verified

55 i = it.previousIndex();
56 }
57 public static void iterManipulation(List<String> a) {
58 ListIterator<String> it = a.listIterator();
59 it.add("47");
60 // Must move to an element after add():
61 it.next();
62 // Remove the element after the new one:
63 it.remove();
64 // Must move to an element after remove():
65 it.next();
66 // Change the element after the deleted one:
67 it.set("47");
68 }
69 public static void testVisual(List<String> a) {
70 System.out.println(a);
71 List<String> b = LIST;

Callers 1

mainMethod · 0.95

Calls 4

nextMethod · 0.65
setMethod · 0.65
addMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected