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
min
TThe minimal value of segment.
max
TThe 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
other
Range<T>
Returns
CompareTo(object)
public int CompareTo(object obj)
Parameters
obj
object
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
other
Range<T>An object to compare with this object.
Returns
- bool
true if the current object is equal to the
other
parameter; otherwise, false.
Equals(object)
Indicates whether this instance and a specified object are equal.
public override readonly bool Equals(object obj)
Parameters
obj
objectAnother object to compare to.
Returns
- bool
true if
obj
and 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
provider
IFormatProvider
Returns
ToString(string)
public readonly string ToString(string format)
Parameters
format
string
Returns
ToString(string, IFormatProvider)
public readonly string ToString(string format, IFormatProvider formatProvider)
Parameters
format
stringformatProvider
IFormatProvider
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)