@Override public int compare(Target o1, Target o2) { return o1.router_addr.compareTo(o2.router_addr); }
public int compareTo(Address o) { if(this == o) return 0; int retval=super.compareTo(o); if(retval != 0) return retval; // at this point o is an IpAddress but perhaps it is also an IpAddressUUID? if(o instanceof IpAddressUUID) { IpAddressUUID other=(IpAddressUUID)o; retval=this.low < other.low? -1 : this.low > other.low? 1 : 0; if(retval != 0) return retval; return this.high < other.high? -1 : this.high > other.high? 1 : 0; } return retval; }
@Override public int compareTo(RouterStub o) { return remote.compareTo(o.remote); }
/** * Establishes an order between 2 addresses. Assumes other contains non-null IpAddress. * Excludes channel_name from comparison. * @return 0 for equality, value less than 0 if smaller, greater than 0 if greater. */ public final int compare(IpAddress other) { return compareTo(other); }
public final boolean equals(Object obj) { if(this == obj) return true; // added Nov 7 2005, makes sense with canonical addresses if(obj == null) return false; return compareTo(obj) == 0; }
public int compareTo(Address o) { if(this == o) return 0; int retval=super.compareTo(o); if(retval != 0) return retval; // at this point o is an IpAddress but perhaps it is also an IpAddressUUID? if(o instanceof IpAddressUUID) { IpAddressUUID other=(IpAddressUUID)o; retval=this.low < other.low? -1 : this.low > other.low? 1 : 0; if(retval != 0) return retval; return this.high < other.high? -1 : this.high > other.high? 1 : 0; } return retval; }
@Override public int compare(Target o1, Target o2) { return o1.router_addr.compareTo(o2.router_addr); }
@Override public int compareTo(RouterStub o) { return remote.compareTo(o.remote); }