1 /* Copyright (c) 2012-2013. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
10 * Contains the information about a foreign node according to
11 * a node we are trying to find.
13 public class Contact implements Comparable<Object> {
17 public Contact(int id, int distance) {
19 this.distance = distance;
26 public int getDistance() {
30 public boolean equals(Object x) {
34 public int compareTo(Object o) {
35 Contact c = (Contact)o;
36 if (distance < c.distance) {
39 else if (distance == c.distance) {
48 public String toString() {
49 return "Contact [id=" + id + ", distance=" + distance + "]";