/// <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)))); }
/// <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); } }
/// <summary> /// GetHashCode. /// </summary> /// <param name="obj"></param> /// <returns>hash code</returns> public int GetHashCode(IEdge obj) { return(obj.GetHashCode()); }
public int GetHashCode(IEdge <T> obj) => obj.GetHashCode();