コード例 #1
0
 private int getSenderLevel(Node sender) {
   for (int i = 0; i < levels.size(); i++) {
     for (Node n : levels.get(i)) {
       if (n.toString().equals(sender.toString())) {
         return i;
       }
     }
   }
   return -1;
 }
コード例 #2
0
 private Node getSender(Node receiver) {
   for (int i = 0; i < messages.size(); i++) {
     SenderReceiverPairs pair = messages.elementAt(i);
     if (pair.getReceiver().toString().equals(receiver.toString())) {
       return pair.getSender();
     }
   }
   return null;
 }