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

Method main

collections/AdapterMethodIdiom.java:34–45  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

32
33public class AdapterMethodIdiom {
34 public static void main(String[] args) {
35 ReversibleArrayList<String> ral =
36 new ReversibleArrayList<>(
37 Arrays.asList("To be or not to be".split(" ")));
38 // Grabs the ordinary iterator via iterator():
39 for(String s : ral)
40 System.out.print(s + " ");
41 System.out.println();
42 // Hand it the Iterable of your choice
43 for(String s : ral.reversed())
44 System.out.print(s + " ");
45 }
46}
47/* Output:
48To be or not to be

Callers

nothing calls this directly

Calls 3

reversedMethod · 0.95
splitMethod · 0.80
printMethod · 0.80

Tested by

no test coverage detected