示例#1
0
        /// <summary>
        /// Determines whether this instance and another specified Berico.LinkAnalysis.Model.IEdge
        /// object have the same value.  The main source for comparison is the Source and Node
        /// properties.
        /// </summary>
        /// <param name="obj">A Berico.LinkAnalysis.Model.IEdge object to be compared to this
        /// instance for equality</param>
        /// <returns>true if the value of the obj parameter is the same as this instance; otherwise,
        /// false.</returns>
        public bool Equals(IEdge obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

            if (this.GetHashCode() != obj.GetHashCode())
            {
                return(false);
            }

            return((Source.Equals(obj.Source)) && ((Target.Equals(obj.Target))));
        }
示例#2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public int CompareTo(IEdge <T> other)
 {
     if (other != null)
     {
         if (TargetNode != null && other.TargetNode == null)
         {
             return(1);
         }
         else if (TargetNode == null && other.TargetNode == null)
         {
             return(0);
         }
         else
         {
             return(GetHashCode().CompareTo(other.GetHashCode()));
         }
     }
     else
     {
         return(1);
     }
 }
示例#3
0
 /// <summary>
 /// GetHashCode.
 /// </summary>
 /// <param name="obj"></param>
 /// <returns>hash code</returns>
 public int GetHashCode(IEdge obj)
 {
     return(obj.GetHashCode());
 }
示例#4
0
 public int GetHashCode(IEdge <T> obj) =>
 obj.GetHashCode();