projects
/
fleet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f33f807
)
API: inert changes (cleanup, visibility, toString())
author
adam
<adam@megacz.com>
Thu, 22 Feb 2007 15:30:26 +0000
(16:30 +0100)
committer
adam
<adam@megacz.com>
Thu, 22 Feb 2007 15:30:26 +0000
(16:30 +0100)
src/edu/berkeley/fleet/api/BenkoBox.java
patch
|
blob
|
history
src/edu/berkeley/fleet/api/Destination.java
patch
|
blob
|
history
src/edu/berkeley/fleet/api/FleetProcess.java
patch
|
blob
|
history
src/edu/berkeley/fleet/api/Instruction.java
patch
|
blob
|
history
diff --git
a/src/edu/berkeley/fleet/api/BenkoBox.java
b/src/edu/berkeley/fleet/api/BenkoBox.java
index
0c05e0d
..
e9a8cc4
100644
(file)
--- a/
src/edu/berkeley/fleet/api/BenkoBox.java
+++ b/
src/edu/berkeley/fleet/api/BenkoBox.java
@@
-3,8
+3,6
@@
import java.util.*;
public abstract class BenkoBox extends Destination {
public abstract class BenkoBox extends Destination {
- /** you should extend subclasses, not this class directly */
- //FIXME
public BenkoBox() { }
/** the descriptive name of this benkobox (relative to its ship) */
public BenkoBox() { }
/** the descriptive name of this benkobox (relative to its ship) */
diff --git
a/src/edu/berkeley/fleet/api/Destination.java
b/src/edu/berkeley/fleet/api/Destination.java
index
6d5bf81
..
c7a0686
100644
(file)
--- a/
src/edu/berkeley/fleet/api/Destination.java
+++ b/
src/edu/berkeley/fleet/api/Destination.java
@@
-2,7
+2,7
@@
package edu.berkeley.fleet.api;
public abstract class Destination {
public abstract class Destination {
- Destination() { }
+ public Destination() { }
/** return the Ship to which this BenkoBox belongs */
public abstract Ship getShip();
/** return the Ship to which this BenkoBox belongs */
public abstract Ship getShip();
diff --git
a/src/edu/berkeley/fleet/api/FleetProcess.java
b/src/edu/berkeley/fleet/api/FleetProcess.java
index
c5aad72
..
096c29e
100644
(file)
--- a/
src/edu/berkeley/fleet/api/FleetProcess.java
+++ b/
src/edu/berkeley/fleet/api/FleetProcess.java
@@
-16,13
+16,13
@@
public abstract class FleetProcess {
/** subclasses may be assured that this will be called exactly once */
protected abstract void _terminate();
/** subclasses may be assured that this will be called exactly once */
protected abstract void _terminate();
- public synchronized void terminate() {
+ public final synchronized void terminate() {
if (terminated) return;
terminated = true;
_terminate();
}
if (terminated) return;
terminated = true;
_terminate();
}
- public boolean isTerminated() {
+ public final boolean isTerminated() {
return terminated;
}
return terminated;
}
diff --git
a/src/edu/berkeley/fleet/api/Instruction.java
b/src/edu/berkeley/fleet/api/Instruction.java
index
3aae37b
..
6482198
100644
(file)
--- a/
src/edu/berkeley/fleet/api/Instruction.java
+++ b/
src/edu/berkeley/fleet/api/Instruction.java
@@
-11,8
+11,10
@@
public abstract class Instruction {
this.benkoBox=benkoBox;
this.count=count;
this.killOnlyStandingInstructions = killOnlyStandingInstructions;
this.benkoBox=benkoBox;
this.count=count;
this.killOnlyStandingInstructions = killOnlyStandingInstructions;
+ if (killOnlyStandingInstructions && count !=1)
+ throw new RuntimeException("currently, kill* must have count=1");
}
}
- public String toString() { return (count>1 ? "["+count+"] " : "") + "kill"; }
+ public String toString() { return (count>1 ? "["+count+"] " : "") + "kill" + (killOnlyStandingInstructions ? "*" : ""); }
}
}
@@
-125,7
+127,7
@@
public abstract class Instruction {
public String toString() {
String off = ""+offset;
if (offset > 0) off = "+"+off;
public String toString() {
String off = ""+offset;
if (offset > 0) off = "+"+off;
- return "(@"+off+":"+size+"): sendto " + dest;
+ return "(CBD @"+off+"+"+size+"): sendto " + dest;
}
}
}
}
}
}