-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMethod.java
More file actions
42 lines (42 loc) · 886 Bytes
/
Method.java
File metadata and controls
42 lines (42 loc) · 886 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
abstract class Method {
boolean completed;
int threadId;
int line;
Method(int t) {
threadId = t;
}
protected void log(int l) {
line = l;
log();
}
protected void log() {
log("");
}
protected void log(String s) {
String indent = new String();
for(int i = 0; i < getIndent(); i++) {
indent += " ";
}
System.out.println(String.format("%1$5s ", line) +
threadId + indent + " " + getName() +
"(" + getArgStr() + ")" + " " + s);
}
public int getLine() {
return line;
}
public String getArgStr() {
return "";
}
public void step(int l) {
line = l;
step();
}
public abstract void step();
public abstract String getName();
public boolean isCompleted() {
return completed;
}
public int getIndent() {
return 0;
}
}