Beispiel #1
0
  /**
   * 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;
  }
Beispiel #2
0
  public RoutingTuple getDestination(InetAddress dest) {
    for (RoutingTuple tuple : this) {
      if (tuple.getDestination().equals(dest)) return tuple;
    }

    return null;
  }
Beispiel #3
0
  public boolean containsDestination(InetAddress dest) {
    for (RoutingTuple tuple : this) {
      if (tuple.getDestination().equals(dest)) return true;
    }

    return false;
  }