Struct Range<T>
- Namespace
- LinqStatistics
- Assembly
- LinqStatistics.dll
An ordered pair of values, representing a segment.
public struct Range<T> : IFormattable, IEquatable<Range<T>>, IComparable, IComparable<Range<T>> where T : struct, IComparable<T>, IFormattable, IEquatable<T>
Type Parameters
T- An ordered pair of values, representing a segment.
- Implements
-
IEquatable<Range<T>>IComparable<Range<T>>
- Inherited Members
Constructors
Range(T, T)
Initializes a new instance of the Range<T> struct.
public Range(T min, T max)
Parameters
minTThe minimal value of segment.
maxTThe maximal value of segment.
Properties
Max
Gets the maximal value of segment.
public readonly T Max { get; }
Property Value
- T
The Max.
Min
Gets the minimal value of segment.
public readonly T Min { get; }
Property Value
- T
The Min.
Methods
CompareTo(Range<T>)
public readonly int CompareTo(Range<T> other)
Parameters
otherRange<T>
Returns
CompareTo(object)
public int CompareTo(object obj)
Parameters
objobject
Returns
Equals(Range<T>)
Indicates whether the current object is equal to another object of the same type.
public readonly bool Equals(Range<T> other)
Parameters
otherRange<T>An object to compare with this object.
Returns
- bool
true if the current object is equal to the
otherparameter; otherwise, false.
Equals(object)
Indicates whether this instance and a specified object are equal.
public override readonly bool Equals(object obj)
Parameters
objobjectAnother object to compare to.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override readonly int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToString()
Returns a string representation of the range
public override readonly string ToString()
Returns
ToString(IFormatProvider)
public readonly string ToString(IFormatProvider provider)
Parameters
providerIFormatProvider
Returns
ToString(string)
public readonly string ToString(string format)
Parameters
formatstring
Returns
ToString(string, IFormatProvider)
public readonly string ToString(string format, IFormatProvider formatProvider)
Parameters
formatstringformatProviderIFormatProvider
Returns
Operators
operator ==(Range<T>, Range<T>)
public static bool operator ==(Range<T> first, Range<T> second)
Parameters
Returns
operator >(Range<T>, Range<T>)
public static bool operator >(Range<T> first, Range<T> second)
Parameters
Returns
operator >=(Range<T>, Range<T>)
public static bool operator >=(Range<T> first, Range<T> second)
Parameters
Returns
operator !=(Range<T>, Range<T>)
public static bool operator !=(Range<T> first, Range<T> second)
Parameters
Returns
operator <(Range<T>, Range<T>)
public static bool operator <(Range<T> first, Range<T> second)
Parameters
Returns
operator <=(Range<T>, Range<T>)
public static bool operator <=(Range<T> first, Range<T> second)