8 String name = "", gid = "";
10 Set<Listener> ls = new HashSet<Listener>();
12 public Hub(int id, String fnet) {
14 this.fnet = fnet.intern();
17 public interface Listener {
18 public void chName(Hub hub);
19 public void chNumPeers(Hub hub);
20 public void chState(Hub hub);
24 Hub ret = new Hub(id, fnet);
25 ret.numpeers = numpeers;
36 public String getGid() {
40 public String getFnet() {
44 public String getName() {
48 public int getNumPeers() {
52 public String getState() {
56 public void addListener(Listener ls) {
57 synchronized(this.ls) {
62 public String toString() {
63 return("Hub (" + id + ", " + fnet + ", \"" + name + "\")");