Interface IRange<T>
Defines a range of ordered values with configurable boundary inclusiveness.
public interface IRange<T> where T : IComparable<T>
Type Parameters
TThe value type of the range boundaries.
- Extension Methods
Properties
ContainsEnd
Gets a value indicating whether End belongs to the range.
bool ContainsEnd { get; }
Property Value
ContainsStart
Gets a value indicating whether Start belongs to the range.
bool ContainsStart { get; }
Property Value
End
Gets the end boundary of the range.
T End { get; }
Property Value
- T
Start
Gets the start boundary of the range.
T Start { get; }
Property Value
- T
Methods
Contains(IRange<T>)
Determines whether this range entirely contains another range.
bool Contains(IRange<T> other)
Parameters
otherIRange<T>The range to test.
Returns
Contains(T)
Determines whether the supplied value belongs to the current range.
bool Contains(T value)
Parameters
valueTThe value to test.
Returns
Intersect(IRange<T>)
Computes one or more intersections between this range and another range.
IRange<T>[] Intersect(IRange<T> other)
Parameters
otherIRange<T>The range to intersect with.
Returns
- IRange<T>[]
An array containing all intersection ranges. The array is empty when ranges are disjoint.
IsCompatibleWith(IRange<T>)
Determines whether the current range model is compatible with another range for aggregation in the same collection.
bool IsCompatibleWith(IRange<T> other)
Parameters
otherIRange<T>The range to compare with.
Returns
Overlap(IRange<T>)
Determines whether this range overlaps with another range.
bool Overlap(IRange<T> other)
Parameters
otherIRange<T>The range to test.