Skip to content
Snippets Groups Projects

Feature #328 iterators instead of list copies

Files

@@ -185,13 +185,16 @@ public class DTNHost implements Comparable<DTNHost>, Addressable {
}
/**
* Returns a copy of the list of connections this host has with other hosts
* Returns a list of connections this host has with other hosts
*
* @return a copy of the list of connections this host has with other hosts
* @return a list of connections this host has with other hosts
*/
public List<Connection> getConnections() {
List<Connection> lc = new ArrayList<Connection>();
if (net.size() == 1){
return net.get(0).getConnections();
}
List<Connection> lc = new ArrayList<>();
for (NetworkInterface i : net) {
lc.addAll(i.getConnections());
}
Loading