/** * 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; }
public RoutingTuple getDestination(InetAddress dest) { for (RoutingTuple tuple : this) { if (tuple.getDestination().equals(dest)) return tuple; } return null; }
public boolean containsDestination(InetAddress dest) { for (RoutingTuple tuple : this) { if (tuple.getDestination().equals(dest)) return true; } return false; }