/** * Compares two USM users by their security names. * @param other * another <code>UsmUser</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(UsmUser other) { // allow only comparison with UsmUsers return securityName.compareTo(other.securityName); }
/** * Compares two USM users by their security names. * @param o * another <code>UsmUser</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) { // allow only comparison with UsmUsers UsmUser other = (UsmUser)o; return securityName.compareTo(other.securityName); }
/** * Compares two USM users by their security names. * @param o * another <code>UsmUser</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) { // allow only comparison with UsmUsers UsmUser other = (UsmUser)o; return securityName.compareTo(other.securityName); }
/** * 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; }
public int compareTo(Object o) { ProxyKey other = (ProxyKey)o; if (((contextEngineID == null) && (other.contextEngineID != null)) || ((other.contextEngineID == null) && (contextEngineID != null)) || ((other.contextEngineID == null) && (contextEngineID == null)) || (contextEngineID.equals(other.contextEngineID))) { if ((proxyType == ProxyForwarder.PROXY_TYPE_ALL) || (other.proxyType == ProxyForwarder.PROXY_TYPE_ALL)) { return 0; } return (proxyType - other.proxyType); } return contextEngineID.compareTo(other.contextEngineID); }
/** * 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; }
public int compareTo(Object o) { ProxyKey other = (ProxyKey)o; if (((contextEngineID == null) && (other.contextEngineID != null)) || ((other.contextEngineID == null) && (contextEngineID != null)) || ((other.contextEngineID == null) && (contextEngineID == null)) || (contextEngineID.equals(other.contextEngineID))) { if ((proxyType == ProxyForwarder.PROXY_TYPE_ALL) || (other.proxyType == ProxyForwarder.PROXY_TYPE_ALL)) { return 0; } return (proxyType - other.proxyType); } return contextEngineID.compareTo(other.contextEngineID); }
public int compareTo(Object o) { if (o instanceof UsmUserEntry) { return compareTo(new UsmUserKey((UsmUserEntry) o)); } UsmUserKey other = (UsmUserKey) o; int result = 0; if ((engineID != null) && (other.engineID != null)) { result = engineID.compareTo(other.engineID); } else if (engineID != null) { result = 1; } else if (other.engineID != null) { result = -1; } if (result == 0) { result = securityName.compareTo(other.securityName); } return result; } }
public int compareTo(Object o) { if (o instanceof UsmUserEntry) { return compareTo(new UsmUserKey((UsmUserEntry)o)); } UsmUserKey other = (UsmUserKey)o; int result = 0; if ((engineID != null) && (other.engineID != null)) { result = engineID.compareTo(other.engineID); } else if (engineID != null) { result = 1; } else if (other.engineID != null) { result = -1; } if (result == 0) { result = securityName.compareTo(other.securityName); } return result; } }
public int compareTo(Object o) { if (o instanceof UsmUserEntry) { return compareTo(new UsmUserKey((UsmUserEntry)o)); } UsmUserKey other = (UsmUserKey)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 = securityName.compareTo(other.securityName); } return result; } }
public int compareTo(Object o) { OctetString a = new OctetString(inetAddress.getAddress()); return a.compareTo(new OctetString(((IpAddress)o).getInetAddress().getAddress())); }
public int compareTo(Variable o) { OctetString a = new OctetString(inetAddress.getAddress()); return a.compareTo(new OctetString(((IpAddress)o).getInetAddress().getAddress())); }
public int compareTo(Variable o) { OctetString a = new OctetString(inetAddress.getAddress()); return a.compareTo(new OctetString(((IpAddress)o).getInetAddress().getAddress())); }
/** * Compares its two OctetString instances for lexicographic order. * * @param os1 the first object to be compared. * @param os2 the second object to be compared. * @return a negative integer, zero, or a positive integer as the first * argument is less than, equal to, or greater than the second. */ public int compare(OctetString os1, OctetString os2) { int result = 0; if (!impliedLength) { result = os1.length() - os2.length(); } if (result == 0) { result = os1.compareTo(os2); } return result; } }
/** * Compares this object with the specified object for order. * * @param o the Object to be compared. * @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) { CoexistenceInfo other = (CoexistenceInfo)o; int c = other.getSecurityName().compareTo(getSecurityName()); if (c == 0) { c = other.getContextEngineID().compareTo(getContextEngineID()); } if (c == 0) { c = other.getContextName().compareTo(getContextName()); } return c; } }
/** * Compares this object with the specified object for order. * * @param o the Object to be compared. * @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) { CoexistenceInfo other = (CoexistenceInfo)o; int c = other.getSecurityName().compareTo(getSecurityName()); if (c == 0) { c = other.getContextEngineID().compareTo(getContextEngineID()); } if (c == 0) { c = other.getContextName().compareTo(getContextName()); } return c; } }
/** * Compares its two OctetString instances for lexicographic order. * * @param o1 the first object to be compared. * @param o2 the second object to be compared. * @return a negative integer, zero, or a positive integer as the first * argument is less than, equal to, or greater than the second. */ public int compare(Object o1, Object o2) { OctetString os1 = (OctetString) o1; OctetString os2 = (OctetString) o2; int result = 0; if (!impliedLength) { result = os1.length() - os2.length(); } if (result == 0) { result = os1.compareTo(os2); } return result; } }
private static int compareContextScope(MOScope scope, MOContextScope scope2) { if (scope == scope2) { return 0; } int result = compareScope(scope, scope2); if ((result == 0) && (scope instanceof MOContextScope)) { OctetString c1 = ((MOContextScope)scope).getContext(); OctetString c2 = scope2.getContext(); if ((c1 != null) && (c2 != null)) { result = c1.compareTo(c2); } } return result; }
private static int compareQueryWithScope(MOScope scope, MOQuery scope2) { int result = 0; if (scope.getUpperBound() == null) { return 1; } else { result = scope.getUpperBound().compareTo(scope2.getLowerBound()); if (result == 0) { if ((!scope.isUpperIncluded()) || (!scope2.isLowerIncluded())) { return -1; } } } if (result == 0) { if (scope instanceof MOContextScope) { OctetString c1 = ((MOContextScope)scope).getContext(); OctetString c2 = scope2.getContext(); if ((c1 != null) && (c2 != null)) { result = c1.compareTo(c2); } } } return result; }
private static int compareScopeAndQuery(MOScope scope, MOQuery query) { int result = 0; if (scope instanceof MOContextScope) { OctetString c1 = ((MOContextScope)scope).getContext(); OctetString c2 = query.getScope().getContext(); if ((c1 != null) && (c2 != null)) { result = c1.compareTo(c2); } } if (result != 0) { return result; } if (scope.getUpperBound() == null) { return 1; } else { result = scope.getUpperBound().compareTo(query.getScope().getLowerBound()); if (result == 0) { if ((!scope.isUpperIncluded()) || (!query.getScope().isLowerIncluded())) { return -1; } } } return result; }