AscendingIntegerRangeCollection Type

Implements an collection of ascending integers, that are stored in a list of ranges.

Constructors

Constructor Description

AscendingIntegerRangeCollection()

Full Usage: AscendingIntegerRangeCollection()

Instance members

Instance member Description

this.Add

Full Usage: this.Add

Parameters:
    element : int - The element to add.

Adds the specified element. Detail: The element is added as a range with a start value equal to element and a count of 1.

element : int

The element to add.

this.AddRangeByFirstAndLastInclusive

Full Usage: this.AddRangeByFirstAndLastInclusive

Parameters:
    first : int - First element of the range to add.
    lastInclusive : int - Last element of the range (inclusive, i.e. this element is included in the range).

Adds a range that is specified by a first value and by a last value (inclusive).

first : int

First element of the range to add.

lastInclusive : int

Last element of the range (inclusive, i.e. this element is included in the range).

ArgumentOutOfRangeException Argument 'to' has to be greater than or equal to argument 'from'

this.Contains

Full Usage: this.Contains

Parameters:
    element : int - The element.

Returns: bool True if the collection contains the element, otherwise false.

Determines whether this collection contains the specified element.

element : int

The element.

Returns: bool

True if the collection contains the element, otherwise false.

this.Contains

Full Usage: this.Contains

Parameters:
    element : int - The element.
    rangeIndex : byref<int> - If the collection contains the element, this value is the index of the range that contains the element.

Returns: bool True if the collection contains the element, otherwise false.

Determines whether this collection contains the specified element.

element : int

The element.

rangeIndex : byref<int>

If the collection contains the element, this value is the index of the range that contains the element.

Returns: bool

True if the collection contains the element, otherwise false.

this.Count

Full Usage: this.Count

Returns: int

Gets the number of elements in the collection.

Returns: int

this.[arg1]

Full Usage: this.[arg1]

Parameters:
    arg0 : int

Returns: int Element at the specified index.

Gets the Int32 element with the specified index.

arg0 : int
Returns: int

Element at the specified index.

IndexOutOfRangeException If idx is less than 0 or greater than or equal to AscendingIntegerRangeCollection.Count.

this.RangeCount

Full Usage: this.RangeCount

Returns: int

Gets the number of ranges in this collection.

Returns: int

this.Ranges

Full Usage: this.Ranges

Returns: IEnumerable<ContiguousIntegerRange>

Gets the ranges of the collection

Returns: IEnumerable<ContiguousIntegerRange>

this.Remove

Full Usage: this.Remove

Parameters:
    element : int - The element to remove.

Removes the specified element.

element : int

The element to remove.

this.RemoveRangeByFirstAndLastInclusive

Full Usage: this.RemoveRangeByFirstAndLastInclusive

Parameters:
    first : int - First element of the range to remove.
    lastInclusive : int - Last element of the range (inclusive, i.e. this element is included in the range).

Removes all elements that belong to the provided range that is specified by a first value and by a last value (inclusive).

first : int

First element of the range to remove.

lastInclusive : int

Last element of the range (inclusive, i.e. this element is included in the range).

ArgumentOutOfRangeException Argument 'to' has to be greater than or equal to argument 'from'