2015-11-11 20:20:04 -08:00
|
|
|
|
// streams/Machine.java
|
2015-11-14 16:18:05 -08:00
|
|
|
|
// <20>2016 MindView LLC: see Copyright.txt
|
2015-11-11 20:20:04 -08:00
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
class Bing implements Operation {
|
|
|
|
|
public void execute() {
|
|
|
|
|
Operation.show("Bing");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class Machine {
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
Operation.runOps(Arrays.asList(
|
|
|
|
|
new Bing(),
|
|
|
|
|
new Operation() {
|
|
|
|
|
public void execute() {
|
|
|
|
|
Operation.show("Anon");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
() -> Operation.show("Crack"),
|
|
|
|
|
() -> Operation.show("Twist"),
|
|
|
|
|
() -> Operation.show("Pop")
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* Output:
|
|
|
|
|
Bing
|
|
|
|
|
Anon
|
|
|
|
|
Crack
|
|
|
|
|
Twist
|
|
|
|
|
Pop
|
|
|
|
|
*/
|