Show / Hide Table of Contents

Struct ListSegment<T>

Delimits a section of a list.

Implements
IList<T>
ICollection<T>
IReadOnlyList<T>
IReadOnlyCollection<T>
IEnumerable<T>
IEnumerable
Inherited Members
ValueType.Equals(Object)
ValueType.GetHashCode()
ValueType.ToString()
Object.Equals(Object, Object)
Object.GetType()
Object.ReferenceEquals(Object, Object)
Namespace: DotNext.Collections.Generic
Assembly: DotNext.dll
Syntax
public struct ListSegment<T> : IList<T>, ICollection<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
Name Description
T

The type of elements in the section.

Remarks

This collection is read-only and does not allow the addition or removal of elements. However individual elements of the list can be modified using indexer.

Constructors

| Improve this Doc View Source

ListSegment(IList<T>, Range)

Initializes a new segment of the list.

Declaration
public ListSegment(IList<T> list, Range range)
Parameters
Type Name Description
IList<T> list

The list containing the range of elements to delimit.

Range range

The range of elements.

Properties

| Improve this Doc View Source

Count

Gets the number of elements in the segment.

Declaration
public int Count { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

Item[Int32]

Gets or sets element at the specified index.

Declaration
public T this[int index] { get; set; }
Parameters
Type Name Description
Int32 index

The index of the element in this segment.

Property Value
Type Description
T
Exceptions
Type Condition
ArgumentOutOfRangeException

index is less than zero; or greater than or equal to Count.

Methods

| Improve this Doc View Source

Contains(T)

Determines whether this section contains a specified value.

Declaration
public bool Contains(T item)
Parameters
Type Name Description
T item

The object to locate in this section.

Returns
Type Description
Boolean

true if item is found in this section; otherwise, false.

| Improve this Doc View Source

CopyTo(T[], Int32)

Copies the elements in this section to an array.

Declaration
public void CopyTo(T[] array, int arrayIndex)
Parameters
Type Name Description
T[] array

The destination of the elements copied from this section.

Int32 arrayIndex

The zero-based index in array at which copying begins.

| Improve this Doc View Source

GetEnumerator()

Gets enumerator of elements in this section.

Declaration
public IEnumerator<T> GetEnumerator()
Returns
Type Description
IEnumerator<T>

The enumerator of elements in this section.

| Improve this Doc View Source

IndexOf(T)

Determines the index of a specific item.

Declaration
public int IndexOf(T item)
Parameters
Type Name Description
T item

The object to locate in this section.

Returns
Type Description
Int32

The index of item in this section; otherwise, -1.

Explicit Interface Implementations

| Improve this Doc View Source

ICollection<T>.Add(T)

Declaration
void ICollection<T>.Add(T item)
Parameters
Type Name Description
T item
| Improve this Doc View Source

ICollection<T>.Clear()

Declaration
void ICollection<T>.Clear()
| Improve this Doc View Source

ICollection<T>.IsReadOnly

Declaration
bool ICollection<T>.IsReadOnly { get; }
Returns
Type Description
Boolean
| Improve this Doc View Source

ICollection<T>.Remove(T)

Declaration
bool ICollection<T>.Remove(T item)
Parameters
Type Name Description
T item
Returns
Type Description
Boolean
| Improve this Doc View Source

IList<T>.Insert(Int32, T)

Declaration
void IList<T>.Insert(int index, T item)
Parameters
Type Name Description
Int32 index
T item
| Improve this Doc View Source

IList<T>.RemoveAt(Int32)

Declaration
void IList<T>.RemoveAt(int index)
Parameters
Type Name Description
Int32 index
| Improve this Doc View Source

IEnumerable.GetEnumerator()

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
IEnumerator

Implements

System.Collections.Generic.IList<T>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IReadOnlyList<T>
System.Collections.Generic.IReadOnlyCollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable

Extension Methods

Collection.Convert<TInput, TOutput>(IReadOnlyCollection<TInput>, ValueFunc<TInput, TOutput>)
Collection.Convert<TInput, TOutput>(IReadOnlyCollection<TInput>, Converter<TInput, TOutput>)
Collection.AddAll<T>(ICollection<T>, IEnumerable<T>)
List.IndexerGetter<T>(IReadOnlyList<T>)
List.IndexerGetter<T>(IList<T>)
List.IndexerSetter<T>(IList<T>)
List.ToArray<TInput, TOutput>(IList<TInput>, ValueFunc<TInput, TOutput>)
List.ToArray<TInput, TOutput>(IList<TInput>, Converter<TInput, TOutput>)
List.ToArray<TInput, TOutput>(IList<TInput>, ValueFunc<Int32, TInput, TOutput>)
List.ToArray<TInput, TOutput>(IList<TInput>, Func<Int32, TInput, TOutput>)
List.Convert<TInput, TOutput>(IReadOnlyList<TInput>, ValueFunc<TInput, TOutput>)
List.Convert<TInput, TOutput>(IReadOnlyList<TInput>, Converter<TInput, TOutput>)
List.InsertOrdered<T>(IList<T>, T, ValueFunc<T, T, Int32>)
List.InsertOrdered<T>(IList<T>, T, Comparison<T>)
List.Insert<T>(IList<T>, Index, T)
List.RemoveAt<T>(IList<T>, Index)
List.Slice<T>(IList<T>, Range)
Sequence.ToAsyncEnumerable<T>(IEnumerable<T>)
Sequence.GetAsyncEnumerator<T>(IEnumerable<T>, CancellationToken)
Sequence.ForEach<T>(IEnumerable<T>, Action<T>)
Sequence.ForEach<T>(IEnumerable<T>, ValueAction<T>)
Sequence.ForEachAsync<T>(IEnumerable<T>, Func<T, CancellationToken, ValueTask>, CancellationToken)
Sequence.ForEachAsync<T>(IEnumerable<T>, ValueFunc<T, CancellationToken, ValueTask>, CancellationToken)
Sequence.FirstOrEmpty<T>(IEnumerable<T>)
Sequence.FirstOrEmpty<T>(IEnumerable<T>, ValueFunc<T, Boolean>)
Sequence.FirstOrEmpty<T>(IEnumerable<T>, Predicate<T>)
Sequence.Skip<TEnumerator, T>(ref TEnumerator, Int32)
Sequence.ElementAt<T>(IEnumerable<T>, Int32, out T)
Sequence.ToString<T>(IEnumerable<T>, String, String)
Sequence.Prepend<T>(IEnumerable<T>, T[])
Sequence.Append<T>(IEnumerable<T>, T[])
ExpressionBuilder.Const<T>(T)
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX