Class Range<T>
Represents a range between a minimum and a maximum value.
public sealed class Range<T> : IEquatable<Range<T>> where T : IComparable<T>
Type Parameters
T
The type of the value.
- Inheritance
-
Range<T>
- Implements
-
IEquatable<Range<T>>
- Inherited Members
Constructors
Range(T, T)
Initializes a new instance of the Range<T> class.
public Range(T min, T max)
Parameters
min
TThe minimum value.
max
TThe maximum value.
Properties
Max
Gets the maximum value.
public T Max { get; }
Property Value
- T
The maximum value.
Min
Gets the minimum value.
public T Min { get; }
Property Value
- T
The minimum value.
Methods
Equals(Range<T>)
public bool Equals(Range<T> other)
Parameters
other
Range<T>
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
Overlaps(Range<T>)
Determines whether this range overlaps with another range.
public bool Overlaps(Range<T> other)
Parameters
other
Range<T>The other range.
Returns
- bool
True if this range overlaps with the other
ToString()
public override string ToString()