/* (non-Javadoc)
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
public int compare(Object arg0, Object arg1) {
if (arg0 instanceof IServiceInfo && arg1 instanceof IServiceInfo) {
final IServiceInfo first = (IServiceInfo) arg0;
final IServiceInfo second = (IServiceInfo) arg1;
final IServiceID firstServiceId = first.getServiceID();
final IServiceID secondServiceId = second.getServiceID();
boolean idsSame = firstServiceId.equals(secondServiceId);
boolean prioSame = first.getPriority() == second.getPriority();
boolean weightSame = first.getWeight() == second.getWeight();
boolean servicePropertiesSame = compareServiceProperties(first.getServiceProperties(), second.getServiceProperties());
boolean ttlSame = first.getTTL() == second.getTTL();
final boolean result = (idsSame && prioSame && weightSame && servicePropertiesSame && ttlSame);
if (result == true) {
return 0;
}
}