forked from ldrmcml/Thinkinginjava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRobot.java
More file actions
26 lines (22 loc) · 646 Bytes
/
Copy pathRobot.java
File metadata and controls
26 lines (22 loc) · 646 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package typeinfo;
//: typeinfo/Robot.java
import java.util.*;
import javax.swing.text.html.HTMLDocument.HTMLReader.IsindexAction;
import net.mindview.util.*;
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();
}
}
}
} ///:~