/// <summary> /// Compares two instances of this object. /// </summary> /// <param name="MiniEdge">A miniedge to compare with.</param> public Int32 CompareTo(MiniEdge <TSource, TEdge, TTarget> MiniEdge) { if ((Object)MiniEdge == null) { throw new ArgumentNullException("The given miniedge must not be null!"); } var source = Source.CompareTo(MiniEdge.Source); var type = EdgeLabel.CompareTo(MiniEdge.EdgeLabel); var target = Target.CompareTo(MiniEdge.Target); if (type != 0) { return(type); } if (source != 0) { return(source); } if (target != 0) { return(target); } return(0); }
/// <summary> /// Compares two miniedges for equality. /// </summary> /// <param name="MiniEdge">A miniedge to compare with.</param> /// <returns>True if both match; False otherwise.</returns> public Boolean Equals(MiniEdge <TSource, TEdge, TTarget> MiniEdge) { if ((Object)MiniEdge == null) { return(false); } if (!Source.Equals(MiniEdge.Source)) { return(false); } if (!EdgeLabel.Equals(MiniEdge.EdgeLabel)) { return(false); } if (!Target.Equals(MiniEdge.Target)) { return(false); } return(true); }