projects
/
sbp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor toInt() and related machinery into Node
[sbp.git]
/
src
/
edu
/
berkeley
/
sbp
/
Node.java
diff --git
a/src/edu/berkeley/sbp/Node.java
b/src/edu/berkeley/sbp/Node.java
index
872e377
..
1dcf050
100644
(file)
--- a/
src/edu/berkeley/sbp/Node.java
+++ b/
src/edu/berkeley/sbp/Node.java
@@
-11,7
+11,8
@@
import java.util.*;
import java.lang.reflect.*;
class Node
import java.lang.reflect.*;
class Node
- implements GraphViz.ToGraphViz {
+ implements IntegerMappable,
+ GraphViz.ToGraphViz {
// GraphViz //////////////////////////////////////////////////////////////////////////////
// GraphViz //////////////////////////////////////////////////////////////////////////////
@@
-36,4
+37,11
@@
class Node
}
public boolean isTransparent() { return false; }
public boolean isHidden() { return false; }
}
public boolean isTransparent() { return false; }
public boolean isHidden() { return false; }
+
+ // IntegerMappable ////////////////////////////////////////////////////////////
+
+ private static int node_idx = 0;
+ private final int idx = node_idx++;
+ public int toInt() { return idx; }
+
}
\ No newline at end of file
}
\ No newline at end of file