src/net/java/sip/communicator/impl/contactlist/MetaContactImpl.java
/**
     * Compares this meta contact with the specified object for order.  Returns
     * a negative integer, zero, or a positive integer as this meta contact is
     * less than, equal to, or greater than the specified object.
     * <p>
     * The result of this method is calculated the following way:
     * <p>
     * (contactsOnline - o.contactsOnline) * 1 000 000  <br>
     * + getDisplayName().compareTo(o.getDisplayName()) * 100 000
     * + getMetaUID().compareTo(o.getMetaUID())<br>
     * <p>
     * Or in other words ordering of meta accounts would be first done by
     * presence status, then display name, and finally (in order to avoid
     * equalities) be the fairly random meta contact metaUID.
     * <p>
     * @param   o the <code>MetaContact</code> 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.
     *
     * @throws ClassCastException if the specified object is not
     *          a MetaContactListImpl
     */
Compares this meta contact with the specified object for order.  Returns
a negative integer, zero, or a positive integer as this meta contact is
less than, equal to, or greater than the specified object.

@throws ClassCastException if the specified object is not
a MetaContactListImpl
Compares this meta contact with the specified object for order . Returns a negative integer zero or a positive integer as this meta contact is less than equal to or greater than the specified object . @throws ClassCastException if the specified object is not a MetaContactListImpl
public int compareTo(MetaContact o)
    {
        MetaContactImpl target = (MetaContactImpl) o;
        int isOnline
            = (contactsOnline > 0)
            ? 1
            : 0;
        int targetIsOnline
            = (target.contactsOnline > 0)
            ? 1
            : 0;
        return ( (10 - isOnline) - (10 - targetIsOnline)) * 100000000
            + getDisplayName().compareToIgnoreCase(target.getDisplayName())
            * 10000
            + getMetaUID().compareTo(target.getMetaUID());
    }
public int compareTo ( MetaContact o ) { MetaContactImpl target = ( MetaContactImpl ) o ; int isOnline = ( contactsOnline > 0 ) ? 1 : 0 ; int targetIsOnline = ( target . contactsOnline > 0 ) ? 1 : 0 ; return ( ( 10 - isOnline ) - ( 10 - targetIsOnline ) ) * 100000000 + getDisplayName ( ) . compareToIgnoreCase ( target . getDisplayName ( ) ) * 10000 + getMetaUID ( ) . compareTo ( target . getMetaUID ( ) ) ; }
Compares this meta contact with the specified object for order.
Compares this meta contact with the specified object for order .