2015-04-20 15:36:01 -07:00
|
|
|
|
//: typeinfo/Robot.java
|
2015-05-29 14:18:51 -07:00
|
|
|
|
// <20>2015 MindView LLC: see Copyright.txt
|
2015-04-20 15:36:01 -07:00
|
|
|
|
import net.mindview.util.*;
|
2015-05-18 23:05:20 -07:00
|
|
|
|
import java.util.*;
|
2015-04-20 15:36:01 -07:00
|
|
|
|
|
|
|
|
|
public interface Robot {
|
|
|
|
|
String name();
|
|
|
|
|
String model();
|
|
|
|
|
List<Operation> operations();
|
|
|
|
|
class Test {
|
|
|
|
|
public static void test(Robot r) {
|
|
|
|
|
if(r instanceof Null)
|
|
|
|
|
System.out.println("[Null Robot]");
|
|
|
|
|
System.out.println("Robot name: " + r.name());
|
|
|
|
|
System.out.println("Robot model: " + r.model());
|
|
|
|
|
for(Operation operation : r.operations()) {
|
|
|
|
|
System.out.println(operation.description());
|
|
|
|
|
operation.command();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} ///:~
|