Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of github.com:simgrid/simgrid
[simgrid.git] / examples / java / dht / kademlia / Answer.java
index 1421529..7a34831 100644 (file)
@@ -16,18 +16,18 @@ public class Answer {
 
   public Answer(int destinationId) {
     this.destinationId = destinationId;
-    nodes = new ArrayList<Contact>();
+    nodes = new ArrayList<>();
   }
 
-  int getDestinationId() {
+  protected int getDestinationId() {
     return destinationId;
   }
 
-  ArrayList<Contact> getNodes() {
+  protected ArrayList<Contact> getNodes() {
     return nodes;
   }
 
-  int size() {
+  protected int size() {
     return nodes.size();
   }
 
@@ -59,7 +59,7 @@ public class Answer {
 
   /* Returns if the destination has been found */
   public boolean destinationFound() {
-    if (nodes.size() < 1) {
+    if (nodes.isEmpty()) {
       return false;
     }
     Contact tail = nodes.get(0);