/** * Returns a destination with the given IP address and the given distance in hops (h) * * @param dest * @param h * @return tuple or null */ public RoutingTuple getDestination(InetAddress dest, int h) { for (RoutingTuple tuple : this) { if (tuple.getDestination().equals(dest) && tuple.getDistance() == h) return tuple; } return null; }