Beispiel #1
0
        public bool Equals(Node x, Node y)
        {
            if (ReferenceEquals(x, y))
            {
                return(true);
            }
            if (ReferenceEquals(x, null) || ReferenceEquals(y, null))
            {
                return(false);
            }

            if (IncludeName && !NameComparer.Equals(x.Name, y.Name))
            {
                return(false);
            }

            if (IncludeUserData && !UserDataComparer.Equals(x.UserData, y.UserData))
            {
                return(false);
            }

            if (IncludeInDegree && x.InDegree != y.InDegree)
            {
                return(false);
            }

            if (IncludeOutDegree && x.OutDegree != y.OutDegree)
            {
                return(false);
            }

            return(true);
        }
Beispiel #2
0
        public bool Equals(Edge x, Edge y)
        {
            if (ReferenceEquals(x, y))
            {
                return(true);
            }
            if (ReferenceEquals(x, null) || ReferenceEquals(y, null))
            {
                return(false);
            }

            if (!EndpointEquals(x, y))
            {
                return(false);
            }

            if (IncludeUserData && !UserDataComparer.Equals(x.UserData, y.UserData))
            {
                return(false);
            }

            return(true);
        }