ContiguousIntegerRange Type

Represents a range of consecutive integers. The range can be empty (in this case both ContiguousIntegerRange.Start as well as ContiguousIntegerRange.Count are zero).

Constructors

Constructor Description

ContiguousIntegerRange(from)

Full Usage: ContiguousIntegerRange(from)

Parameters:

Constructs an integer range from another integer range.

from : IContiguousIntegerRange

The integer range to copy from.

Instance members

Instance member Description

this.Add

Full Usage: this.Add

Parameters:
    item : int

item : int

this.Clear

Full Usage: this.Clear

this.Clone

Full Usage: this.Clone

Returns: obj
Modifiers: abstract

Returns: obj

this.Contains

Full Usage: this.Contains

Parameters:
    item : int

Returns: bool
Modifiers: abstract

item : int
Returns: bool

this.CopyTo

Full Usage: this.CopyTo

Parameters:
    array : int[]
    arrayIndex : int

array : int[]
arrayIndex : int

this.Count

Full Usage: this.Count

Returns: int
Modifiers: abstract

Number of elements of the integer range.Thus the integer range contains Start, Start+1, .. Start+Count-1.

Returns: int

this.EndExclusive

Full Usage: this.EndExclusive

Returns: int

Element immmediately after the last valid element (is equal to ContiguousIntegerRange.Start+ContiguousIntegerRange.Count).

Returns: int

this.First

Full Usage: this.First

Returns: int

Start value of the integer range.

Returns: int

this.IndexOf

Full Usage: this.IndexOf

Parameters:
    item : int

Returns: int

item : int
Returns: int

this.Insert

Full Usage: this.Insert

Parameters:
    index : int
    item : int

index : int
item : int

this.IsEmpty

Full Usage: this.IsEmpty

Returns: bool

Returns true if the range is empty, i.e. has no elements.

Returns: bool

this.IsReadOnly

Full Usage: this.IsReadOnly

Returns: bool

Returns: bool

this.[arg1]

Full Usage: this.[arg1]

Returns: int
Modifiers: abstract

Returns: int

this.LastInclusive

Full Usage: this.LastInclusive

Returns: int

Last valid element of the integer range (is equal to ContiguousIntegerRange.Start+ContiguousIntegerRange.Count-1).

Returns: int

this.LongCount

Full Usage: this.LongCount

Returns: int64

Number of elements of the integer range.Thus the integer range contains Start, Start+1, .. Start+Count-1.

Returns: int64

this.RangesAscending

Full Usage: this.RangesAscending

Returns: IEnumerable<ContiguousIntegerRange>
Modifiers: abstract

Returns: IEnumerable<ContiguousIntegerRange>

this.RangesDescending

Full Usage: this.RangesDescending

Returns: IEnumerable<ContiguousIntegerRange>
Modifiers: abstract

Returns: IEnumerable<ContiguousIntegerRange>

this.Remove

Full Usage: this.Remove

Parameters:
    item : int

Returns: bool

item : int
Returns: bool

this.RemoveAt

Full Usage: this.RemoveAt

Parameters:
    index : int

index : int

this.Start

Full Usage: this.Start

Returns: int
Modifiers: abstract

Start value of the integer range.

Returns: int

Static members

Static member Description

ContiguousIntegerRange.Empty

Full Usage: ContiguousIntegerRange.Empty

Returns: ContiguousIntegerRange

Gets a standard empty integer range (ContiguousIntegerRange.Start and ContiguousIntegerRange.Count set to zero).

Returns: ContiguousIntegerRange

ContiguousIntegerRange.FromFirstAndLastInclusive(start, last)

Full Usage: ContiguousIntegerRange.FromFirstAndLastInclusive(start, last)

Parameters:
    start : int - First element belonging to the range.
    last : int - Last element belonging to the range.

Returns: ContiguousIntegerRange Newly constructed integer range.

Constructs an integer range from the first and the last element of the range. Note that because last has to be greater than or equal to start, it is not possible to create an empty range with this method.

start : int

First element belonging to the range.

last : int

Last element belonging to the range.

Returns: ContiguousIntegerRange

Newly constructed integer range.

ContiguousIntegerRange.FromStartAndCount(start, count)

Full Usage: ContiguousIntegerRange.FromStartAndCount(start, count)

Parameters:
    start : int - First element belonging to the range.
    count : int - Number of consecutive integers belonging to the range.

Returns: ContiguousIntegerRange Newly constructed integer range.

Constructs an integer range from the first element and the number of element of the range. An empty range (with start=0 and count=0) is constructed if count is zero.

start : int

First element belonging to the range.

count : int

Number of consecutive integers belonging to the range.

Returns: ContiguousIntegerRange

Newly constructed integer range.

ContiguousIntegerRange.FromStartAndEndExclusive(start, end)

Full Usage: ContiguousIntegerRange.FromStartAndEndExclusive(start, end)

Parameters:
Returns: ContiguousIntegerRange Newly constructed integer range.

Constructs an integer range from the first element and the element following immediately after the last element. An empty range (with start=0 and count=0) is constructed if start is equal to end.

start : int

First element belonging to the range.

end : int

Element following immediately after the last element, i.e. ContiguousIntegerRange.LastInclusive+1.

Returns: ContiguousIntegerRange

Newly constructed integer range.