Click or drag to resize

RangeT Class

Represents a range of values. An IComparer{T} is used to compare specific values with a start and end point. A range may be include or exclude each end individually. A range which is half-open but has the same start and end point is deemed to be empty, e.g. [3,3) doesn't include 3. To create a range with a single value, use an inclusive range, e.g. [3,3]. Ranges are always immutable - calls such as IncludeEnd() and ExcludeEnd() return a new range without modifying this one.
Inheritance Hierarchy
SystemObject
  Koden.UtilsRangeT

Namespace:  Koden.Utils
Assembly:  Koden.Utils (in Koden.Utils.dll) Version: 1.1.6453.26060
Syntax
public sealed class Range<T>

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "T:Koden.Utils.Range`1"]

The RangeT type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyComparer
Comparer to use for comparisons
Public propertyEnd
The end of the range.
Public propertyIncludesEnd
Whether or not this range includes the end point
Public propertyIncludesStart
Whether or not this range includes the start point
Public propertyStart
The start of the range.
Top
Methods
  NameDescription
Public methodContains
Returns whether or not the range contains the given value
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExcludeEnd
Returns a range with the same boundaries as this, but excluding the end point. When called on a range already excluding the end point, the original range is returned.
Public methodExcludeStart
Returns a range with the same boundaries as this, but excluding the start point. When called on a range already excluding the start point, the original range is returned.
Public methodFromEnd
Returns an iterator which begins at the end of this range, applying the given step delegate on each iteration until the start is reached or passed. The start and end points are included or excluded according to this range.
Public methodFromStart
Returns an iterator which begins at the start of this range, applying the given step delegate on each iteration until the end is reached or passed. The start and end points are included or excluded according to this range.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIncludeEnd
Returns a range with the same boundaries as this, but including the end point. When called on a range already including the end point, the original range is returned.
Public methodIncludeStart
Returns a range with the same boundaries as this, but including the start point. When called on a range already including the start point, the original range is returned.
Public methodStep
Returns an iterator which steps through the range, applying the specified step delegate on each iteration. The method determines whether to begin at the start or end of the range based on whether the step delegate appears to go "up" or "down". The step delegate is applied to the start point. If the result is more than the start point, the returned iterator begins at the start point; otherwise it begins at the end point.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also