1 /* Copyright (c) 2012-2014, 2016. 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. */
9 public class Contact implements Comparable<Object> {
13 public Contact(int id, int distance) {
15 this.distance = distance;
22 public int getDistance() {
27 public boolean equals(Object x) {
32 public int compareTo(Object o) {
33 Contact c = (Contact)o;
34 if (distance < c.distance) {
37 else if (distance == c.distance) {
46 public String toString() {
47 return "Contact [id=" + id + ", distance=" + distance + "]";