/// <inheritdoc /> bool IEquatable <IUniformResourceIdentifier> .Equals(IUniformResourceIdentifier other) => ComparableImplementations.ImplementEquals(DefaultComparer, this, other);
/// <summary> /// Returns a value indicating the relative order of this instance and the specified object: a negative value if this instance is less than the specified object; zero if this instance is equal to the specified object; and a positive value if this instance is greater than the specified object. /// </summary> /// <param name="obj">The object to compare with this instance.</param> /// <returns>A value indicating the relative order of this instance and the specified object: a negative value if this instance is less than the specified object; zero if this instance is equal to the specified object; and a positive value if this instance is greater than the specified object.</returns> int IComparable.CompareTo(object obj) { return(ComparableImplementations.ImplementCompareTo(DefaultComparer, this, obj)); }
/// <summary> /// Returns a value indicating the relative order of this instance and the specified object: a negative value if this instance is less than the specified object; zero if this instance is equal to the specified object; and a positive value if this instance is greater than the specified object. /// </summary> /// <param name="other">The object to compare with this instance.</param> /// <returns>A value indicating the relative order of this instance and the specified object: a negative value if this instance is less than the specified object; zero if this instance is equal to the specified object; and a positive value if this instance is greater than the specified object.</returns> public int CompareTo(T other) { Contract.Assume(DefaultComparer != null); return(ComparableImplementations.ImplementCompareTo(DefaultComparer, (T)this, other)); }
/// <summary> /// Returns <c>true</c> if <paramref name="left"/> has a value that is greater than or equal to the value of <paramref name="right"/>. /// </summary> /// <param name="left">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <param name="right">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <returns><c>true</c> if <paramref name="left"/> has a value that is greater than or equal to the value of <paramref name="right"/>; otherwise, <c>false</c>.</returns> public static bool operator >=(ComparableBaseWithOperators <T> left, ComparableBaseWithOperators <T> right) { return(ComparableImplementations.ImplementOpGreaterThanOrEqual(DefaultComparer, (T)left, (T)right)); }
/// <summary> /// Returns a value indicating whether this instance is equal to the specified object. /// </summary> /// <param name="obj">The object to compare with this instance.</param> /// <returns>A value indicating whether this instance is equal to the specified object.</returns> public override bool Equals(object obj) { return(ComparableImplementations.ImplementEquals(DefaultComparer, this, obj)); }
/// <summary> /// Returns a value indicating the relative order of this instance and the specified object: a negative value if this instance is less than the specified object; zero if this instance is equal to the specified object; and a positive value if this instance is greater than the specified object. /// </summary> /// <param name="other">The object to compare with this instance.</param> /// <returns>A value indicating the relative order of this instance and the specified object: a negative value if this instance is less than the specified object; zero if this instance is equal to the specified object; and a positive value if this instance is greater than the specified object.</returns> public int CompareTo(T other) => ComparableImplementations.ImplementCompareTo(DefaultComparer, (T)this, other);
/// <summary> /// Returns <c>true</c> if two <typeparamref name="T"/> objects have different values. /// </summary> /// <param name="left">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <param name="right">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <returns><c>true</c> if two <typeparamref name="T"/> objects have different values; otherwise, <c>false</c>.</returns> public static bool operator !=(ComparableBaseWithOperators <T> left, ComparableBaseWithOperators <T> right) { return(ComparableImplementations.ImplementOpInequality(DefaultComparer, (T)left, (T)right)); }
/// <summary> /// Gets the hash code for this instance. /// </summary> /// <returns>The hash code for this instance.</returns> public override int GetHashCode() { Contract.Assume(DefaultComparer != null); return(ComparableImplementations.ImplementGetHashCode(DefaultComparer, (T)this)); }
/// <summary> /// Returns a value indicating whether this instance is equal to the specified object. /// </summary> /// <param name="obj">The object to compare with this instance.</param> /// <returns>A value indicating whether this instance is equal to the specified object.</returns> public override bool Equals(object obj) { Contract.Assume(DefaultComparer != null); return(ComparableImplementations.ImplementEquals(DefaultComparer, (T)this, obj)); }
/// <summary> /// Returns <c>true</c> if <paramref name="left"/> has a value that is greater than the value of <paramref name="right"/>. /// </summary> /// <param name="left">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <param name="right">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <returns><c>true</c> if <paramref name="left"/> has a value that is greater than the value of <paramref name="right"/>; otherwise, <c>false</c>.</returns> public static bool operator >(ComparableBaseWithOperators <T> left, ComparableBaseWithOperators <T> right) => ComparableImplementations.ImplementOpGreaterThan(DefaultComparer, (T)left, (T)right);
/// <summary> /// Returns <c>true</c> if <paramref name="left"/> has a value that is less than or equal to the value of <paramref name="right"/>. /// </summary> /// <param name="left">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <param name="right">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <returns><c>true</c> if <paramref name="left"/> has a value that is less than or equal to the value of <paramref name="right"/>; otherwise, <c>false</c>.</returns> public static bool operator <=(ComparableBaseWithOperators <T> left, ComparableBaseWithOperators <T> right) => ComparableImplementations.ImplementOpLessThanOrEqual(DefaultComparer, (T)left, (T)right);
/// <summary> /// Returns <c>true</c> if two <typeparamref name="T"/> objects have the same value. /// </summary> /// <param name="left">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <param name="right">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <returns><c>true</c> if two <typeparamref name="T"/> objects have the same value; otherwise, <c>false</c>.</returns> public static bool operator ==(EquatableBaseWithOperators <T>?left, EquatableBaseWithOperators <T>?right) => ComparableImplementations.ImplementOpEquality(DefaultComparer, (T)left !, (T)right !);
/// <summary> /// Returns a value indicating whether this instance is equal to the specified object. /// </summary> /// <param name="obj">The object to compare with this instance.</param> /// <returns>A value indicating whether this instance is equal to the specified object.</returns> public override bool Equals(object obj) => ComparableImplementations.ImplementEquals(DefaultComparer, (T)this, obj);
/// <summary> /// Returns <c>true</c> if two <typeparamref name="T"/> objects have different values. /// </summary> /// <param name="left">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <param name="right">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <returns><c>true</c> if two <typeparamref name="T"/> objects have different values; otherwise, <c>false</c>.</returns> public static bool operator !=(EquatableBaseWithOperators <T> left, EquatableBaseWithOperators <T> right) { Contract.Assume(DefaultComparer != null); return(ComparableImplementations.ImplementOpInequality(DefaultComparer, (T)left, (T)right)); }
/// <inheritdoc /> int IComparable <IUniformResourceIdentifier> .CompareTo(IUniformResourceIdentifier other) => ComparableImplementations.ImplementCompareTo(DefaultComparer, this, other);
/// <summary> /// Returns a value indicating whether this instance is equal to the specified object. /// </summary> /// <param name="other">The object to compare with this instance.</param> /// <returns>A value indicating whether this instance is equal to the specified object.</returns> public bool Equals(T other) { Contract.Assume(DefaultComparer != null); return(ComparableImplementations.ImplementEquals(DefaultComparer, (T)this, other)); }
/// <summary> /// Returns a value indicating the relative order of this instance and the specified object: a negative value if this instance is less than the specified object; zero if this instance is equal to the specified object; and a positive value if this instance is greater than the specified object. /// </summary> /// <param name="obj">The object to compare with this instance.</param> /// <returns>A value indicating the relative order of this instance and the specified object: a negative value if this instance is less than the specified object; zero if this instance is equal to the specified object; and a positive value if this instance is greater than the specified object.</returns> int IComparable.CompareTo(object obj) => ComparableImplementations.ImplementCompareTo(DefaultComparer, this, obj);
/// <summary> /// Returns <c>true</c> if two <typeparamref name="T"/> objects have different values. /// </summary> /// <param name="left">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <param name="right">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <returns><c>true</c> if two <typeparamref name="T"/> objects have different values; otherwise, <c>false</c>.</returns> public static bool operator !=(EquatableBaseWithOperators <T> left, EquatableBaseWithOperators <T> right) => ComparableImplementations.ImplementOpInequality(DefaultComparer, (T)left, (T)right);
/// <summary> /// Returns <c>true</c> if <paramref name="left"/> has a value that is less than or equal to the value of <paramref name="right"/>. /// </summary> /// <param name="left">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <param name="right">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <returns><c>true</c> if <paramref name="left"/> has a value that is less than or equal to the value of <paramref name="right"/>; otherwise, <c>false</c>.</returns> public static bool operator <=(ComparableBaseWithOperators <T> left, ComparableBaseWithOperators <T> right) { Contract.Assume(DefaultComparer != null); return(ComparableImplementations.ImplementOpLessThanOrEqual(DefaultComparer, (T)left, (T)right)); }
public int CompareTo(Derived2 other) => ComparableImplementations.ImplementCompareTo(DefaultComparer, this, other);
/// <summary> /// Returns <c>true</c> if <paramref name="left"/> has a value that is less than the value of <paramref name="right"/>. /// </summary> /// <param name="left">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <param name="right">A value of type <typeparamref name="T"/> or <c>null</c>.</param> /// <returns><c>true</c> if <paramref name="left"/> has a value that is less than the value of <paramref name="right"/>; otherwise, <c>false</c>.</returns> public static bool operator <(ComparableBaseWithOperators <T> left, ComparableBaseWithOperators <T> right) { return(ComparableImplementations.ImplementOpLessThan(DefaultComparer, (T)left, (T)right)); }
public override int CompareTo(object obj) => ComparableImplementations.ImplementCompareTo(DefaultComparer, this, obj);
/// <summary> /// Gets the hash code for this instance. /// </summary> /// <returns>The hash code for this instance.</returns> public override int GetHashCode() { return(ComparableImplementations.ImplementGetHashCode(DefaultComparer, (T)this)); }
public bool Equals(Derived2 other) => ComparableImplementations.ImplementEquals(DefaultComparer, this, other);
/// <summary> /// Returns a value indicating whether this instance is equal to the specified object. /// </summary> /// <param name="other">The object to compare with this instance.</param> /// <returns>A value indicating whether this instance is equal to the specified object.</returns> public bool Equals(T other) { return(ComparableImplementations.ImplementEquals(DefaultComparer, (T)this, other)); }
public override int GetHashCode() => ComparableImplementations.ImplementGetHashCode(DefaultComparer, this);
/// <summary> /// Returns a value indicating the relative order of this instance and the specified object: a negative value if this instance is less than the specified object; zero if this instance is equal to the specified object; and a positive value if this instance is greater than the specified object. /// </summary> /// <param name="other">The object to compare with this instance.</param> /// <returns>A value indicating the relative order of this instance and the specified object: a negative value if this instance is less than the specified object; zero if this instance is equal to the specified object; and a positive value if this instance is greater than the specified object.</returns> public int CompareTo(T other) { return(ComparableImplementations.ImplementCompareTo(DefaultComparer, (T)this, other)); }
/// <summary> /// Returns a value indicating the relative order of this instance and the specified object: a negative value if this instance is less than the specified object; zero if this instance is equal to the specified object; and a positive value if this instance is greater than the specified object. /// </summary> /// <param name="obj">The object to compare with this instance.</param> /// <returns>A value indicating the relative order of this instance and the specified object: a negative value if this instance is less than the specified object; zero if this instance is equal to the specified object; and a positive value if this instance is greater than the specified object.</returns> int IComparable.CompareTo(object obj) { Contract.Assume(DefaultComparer != null); return(ComparableImplementations.ImplementCompareTo(DefaultComparer, this, obj)); }