/** * Compares this user entry with another one by engine ID then by their user * names. * * @param other * a <code>UsmUserEntry</code> instance. * @return * a negative integer, zero, or a positive integer as this object is * less than, equal to, or greater than the specified object. */ public int compareTo(UsmUserEntry other) { int result = 0; if ((engineID != null) && (other.engineID != null)) { result = engineID.compareTo(other.engineID); } else if ((engineID != null) && (other.engineID == null)) { result = 1; } else if ((engineID == null) && (other.engineID != null)) { result = -1; } if (result == 0) { result = userName.compareTo(other.userName); if (result == 0) { result = usmUser.compareTo(other.usmUser); } } return result; }
/** * Compares this user entry with another one by engine ID then by their user * names. * * @param o * a <code>UsmUserEntry</code> instance. * @return * a negative integer, zero, or a positive integer as this object is * less than, equal to, or greater than the specified object. */ public int compareTo(Object o) { UsmUserEntry other = (UsmUserEntry)o; int result = 0; if ((engineID != null) && (other.engineID != null)) { result = engineID.compareTo(other.engineID); } else if ((engineID != null) && (other.engineID == null)) { result = 1; } else if ((engineID == null) && (other.engineID != null)) { result = -1; } if (result == 0) { result = userName.compareTo(other.userName); if (result == 0) { result = usmUser.compareTo(other.usmUser); } } return result; }
/** * Compares this user entry with another one by engine ID then by their user * names. * * @param o * a <code>UsmUserEntry</code> instance. * @return * a negative integer, zero, or a positive integer as this object is * less than, equal to, or greater than the specified object. */ public int compareTo(Object o) { UsmUserEntry other = (UsmUserEntry)o; int result = 0; if ((engineID != null) && (other.engineID != null)) { result = engineID.compareTo(other.engineID); } else if ((engineID != null) && (other.engineID == null)) { result = 1; } else if ((engineID == null) && (other.engineID != null)) { result = -1; } if (result == 0) { result = userName.compareTo(other.userName); if (result == 0) { result = usmUser.compareTo(other.usmUser); } } return result; }