-/* Copyright (c) 2012-2014, 2016. The SimGrid Team.
+/* Copyright (c) 2012-2014, 2016-2017. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
public RoutingTable(int id) {
this.id = id;
- buckets = new Vector<Bucket>();
+ buckets = new Vector<>();
for (int i = 0; i < Common.IDENTIFIER_SIZE + 1; i++) {
buckets.add(new Bucket(i));
}
Msg.debug("Adding " + id + " to my routing table");
bucket.add(id);
if (bucket.size() > Common.BUCKET_SIZE) {
- //TODO: Ping the least seen guy and remove him if he is offline.
+ // TODO
+ Msg.debug("Should ping the least seen guy and remove him if he is offline.");
}
}
}
@Override
public String toString() {
- String string = "RoutingTable [ id=" + id + " " ;
+ StringBuilder string = new StringBuilder("RoutingTable [ id=" + id + " ");
for (int i = 0; i < buckets.size(); i++) {
if (buckets.get(i).size() > 0) {
- string += buckets.get(i) + " ";
+ string.append(buckets.get(i) + " ");
}
}
- return string;
+ return string.toString();
}
}