Averages avgs = (Averages) e.nextElement(); rtt = (int) (avgs.commRTT.getAverage() + (includeNodeTime ? avgs.nodeTme.getAverage() : 0.0));
key = node; NodeTimeAverage nodeTimeAvg = (NodeTimeAverage) roundtripTable.get (key); if (nodeTimeAvg != null) nodeTime = nodeTimeAvg.nodeTime.getAverage(); }  for (Enumeration e=commTable.elements(); e.hasMoreElements(); ) { RunningAverage commRTT = (RunningAverage) e.nextElement(); rtt = (int) (commRTT.getAverage() + nodeTime);
  private static int getBestRTTForLink (DestinationLink link, String node, boolean includeNodeTime)  {    synchronized (roundtripTable)    {      String sendLink = getName (link);      String key = sendLink +"-"+ node;      Hashtable table = (Hashtable) roundtripTable.get (key);      if (table != null)      {        //  Go through the table and find the smallest non-zero average roundtrip time        int rtt, smallestRTT = Integer.MAX_VALUE;              for (Enumeration e=table.elements(); e.hasMoreElements(); )        {          Averages avgs = (Averages) e.nextElement();          rtt = (int) (avgs.commRTT.getAverage() + (includeNodeTime ? avgs.nodeTme.getAverage() : 0.0));          if (rtt > 0 && rtt < smallestRTT) smallestRTT = rtt;        }        if (smallestRTT != Integer.MAX_VALUE) return smallestRTT;      }            return 0;  // no non-zero rtt average available    }  }