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

Class Applicator

interfaces/Applicator.java:38–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38public class Applicator {
39 public static void apply(Processor p, Object s) {
40 System.out.println("Using Processor " + p.name());
41 System.out.println(p.process(s));
42 }
43 public static void main(String[] args) {
44 String s =
45 "We are such stuff as dreams are made on";
46 apply(new Upcase(), s);
47 apply(new Downcase(), s);
48 apply(new Splitter(), s);
49 }
50}
51/* Output:
52Using Processor Upcase
53WE ARE SUCH STUFF AS DREAMS ARE MADE ON

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected