public int CompareTo(object obj)
        {
            User other = obj as User;

            if (other == null)
            {
                return(0);
            }

            int iNickname = String.Compare(Nickname, other.Nickname, StringComparison.InvariantCulture);

            if (iNickname != 0)
            {
                return(iNickname);
            }

            int iId = Id.CompareTo(other.Id);

            if (iId != 0)
            {
                return(iId);
            }

            int iPid = Pid.CompareTo(other.Pid);

            if (iPid != 0)
            {
                return(iPid);
            }

            return(0);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Overrides <see cref="IComparable{PropertyKey}.CompareTo(PropertyKey)"/>. Compares two <see cref="PropertyKey"/>s by <see cref="FmtId"/> and <see cref="Pid"/>
        /// </summary>
        /// <param name="other">The PropertyKey to compare with</param>
        /// <returns>An integer value indicating the result of the comparison</returns>
        public int CompareTo(PropertyKey other)
        {
            int r = FmtId.CompareTo(other.FmtId);

            if (r == 0)
            {
                r = Pid.CompareTo(other.Pid);
            }
            return(r);
        }
Ejemplo n.º 3
0
        public int CompareTo(OtpErlangFun other)
        {
            if (other is null)
            {
                return(1);
            }
            int res = Pid.CompareTo(other.Pid);

            if (res == 0)
            {
                res = Module.CompareTo(other.Module);
            }
            if (res == 0)
            {
                res = Arity.CompareTo(other.Arity);
            }
            if (res == 0)
            {
                res = Md5.CompareTo(other.Md5);
            }
            if (res == 0)
            {
                res = Index.CompareTo(other.Index);
            }
            if (res == 0)
            {
                res = OldIndex.CompareTo(other.OldIndex);
            }
            if (res == 0)
            {
                res = Uniq.CompareTo(other.Uniq);
            }
            if (res == 0)
            {
                res = FreeVars.CompareTo(other.FreeVars);
            }
            return(res);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Compares two instances of ObjectId
        /// </summary>
        public int CompareTo(ObjectId other)
        {
            var r = Timestamp.CompareTo(other.Timestamp);

            if (r != 0)
            {
                return(r);
            }

            r = Machine.CompareTo(other.Machine);
            if (r != 0)
            {
                return(r);
            }

            r = Pid.CompareTo(other.Pid);
            if (r != 0)
            {
                return(r < 0 ? -1 : 1);
            }

            return(Increment.CompareTo(other.Increment));
        }