Table of Contents

Interface IRange<T>

Namespace
Utils.Range
Assembly
Utils.dll

Defines a range of ordered values with configurable boundary inclusiveness.

public interface IRange<T> where T : IComparable<T>

Type Parameters

T

The 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

bool

ContainsStart

Gets a value indicating whether Start belongs to the range.

bool ContainsStart { get; }

Property Value

bool

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

other IRange<T>

The range to test.

Returns

bool

true when other is fully contained; otherwise, false.

Contains(T)

Determines whether the supplied value belongs to the current range.

bool Contains(T value)

Parameters

value T

The value to test.

Returns

bool

true when the value is in range; otherwise, false.

Intersect(IRange<T>)

Computes one or more intersections between this range and another range.

IRange<T>[] Intersect(IRange<T> other)

Parameters

other IRange<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

other IRange<T>

The range to compare with.

Returns

bool

true when both ranges can coexist in the same Ranges<T>; otherwise, false.

Overlap(IRange<T>)

Determines whether this range overlaps with another range.

bool Overlap(IRange<T> other)

Parameters

other IRange<T>

The range to test.

Returns

bool

true when ranges overlap; otherwise, false.