示例#1
0
        public int CompareTo(ErlLink other)
        {
            int n = Node.CompareTo(other.Node);

            if (n != 0)
            {
                return(n);
            }
            return(Pid.CompareTo(other.Pid));
        }
示例#2
0
        /// <summary>
        /// Compare this instance to the IErlObject.
        /// Negative value means that the value is less than obj, positive - greater than the obj
        /// </summary>
        public int CompareTo(IErlObject obj)
        {
            if (!(obj is ErlPid))
            {
                return(TypeOrder < obj.TypeOrder ? -1 : 1);
            }

            var rhs = (ErlPid)obj;
            int n   = Node.CompareTo(rhs.Node);

            if (n != 0)
            {
                return(n);
            }
            return(m_Num.CompareTo(rhs.m_Num));
        }
示例#3
0
        /// <summary>
        /// Compare this instance to the IErlObject.
        /// Negative value means that the value is less than obj, positive - greater than the obj
        /// </summary>
        public int CompareTo(IErlObject obj)
        {
            if (!(obj is ErlPort))
            {
                return(TypeOrder < obj.TypeOrder ? -1 : 1);
            }

            var rhs = (ErlPort)obj;
            int n   = Node.CompareTo(rhs.Node);

            if (n != 0)
            {
                return(n);
            }
            n = Id.CompareTo(rhs.Id);
            if (n != 0)
            {
                return(n);
            }
            return(Creation.CompareTo(rhs.Creation));
        }
示例#4
0
文件: ErlRef.cs 项目: zhabis/nfx
        /// <summary>
        /// Compare this instance to the IErlObject.
        /// Negative value means that the value is less than obj, positive - greater than the obj
        /// </summary>
        public int CompareTo(IErlObject obj)
        {
            if (!(obj is ErlRef))
            {
                return(TypeOrder < obj.TypeOrder ? -1 : 1);
            }

            var rhs = (ErlRef)obj;
            int n   = Node.CompareTo(rhs.Node);

            if (n != 0)
            {
                return(n);
            }
            for (int i = 0; i < Ids.Length; i++)
            {
                int m = Ids[i].CompareTo(rhs.Ids[i]);
                if (m != 0)
                {
                    return(m);
                }
            }
            return(Creation.CompareTo(rhs.Creation));
        }
示例#5
0
        public int CompareTo(ErlLink other)
        {
            var n = Node.CompareTo(other.Node);

            return(n != 0 ? n : Pid.CompareTo(other.Pid));
        }