Table of Contents

Namespace Utils.Range

Classes

CyclicRange<T>

Represents an inclusive range on a cyclic domain.

DateTimeRanges

Represents a collection of ranges for DateTime values, with parsing support from string representations.

DoubleRanges

Represents a collection of ranges for double values, with parsing support from string representations.

IntRange<T>

Represents a collection of integer intervals (ranges), each of which may include negative or positive infinity as an endpoint.

Bitwise-like operators for set operations: | (Union), & (Intersection), ^ (Symmetric Difference), ~ (Complement).

Internally stores multiple non-overlapping intervals sorted by their (Min, Max). A null Minimum => -∞. A null Maximum => +∞.

RangeUtils

Provides extension methods for creating and manipulating ranges on read-only lists.

Ranges<T>

Represents a set of intervals (ranges) for an ordered type T. Provides set-like operations (union, intersection, difference, symmetric difference) via operators: | => Union, & => Intersection, ^ => Symmetric Difference,

  • => Difference (Except).

There is deliberately no complement operation: T is only constrained by IComparable<T>, and IRange<T> carries no notion of a domain, a minimum/maximum value, or infinite bounds, so a complement relative to "the entire domain" cannot be computed in general (an empty Ranges<T> would not even have a domain to recover it from). Types that explicitly model their complete domain, such as IntRange<T>, can define their own well-defined complement instead.

The intervals are stored internally as disjoint, sorted Range<T> objects.

ReadOnlyRange<T>

Represents a read-only range of elements in a list, supporting custom stepping and indexing.

SingleRanges

Represents a collection of ranges for float values, with parsing support from string representations.

TimeRange

Represents an inclusive cyclic range of TimeOnly values.

Structs

Range<T>

Represents a range of values with a start and end, plus inclusivity flags. Stored as a struct for efficient copying.

Interfaces

IRange<T>

Defines a range of ordered values with configurable boundary inclusiveness.