Show / Hide Table of Contents

    Class Segment<T>

    Represents the segment of an .

    Представляет сегмент .

    Inheritance
    Object
    Segment<T>
    ArrayString<T>
    CharSegment
    Implements
    IList<T>
    Namespace: Platform.Collections.Segments
    Assembly: Platform.Collections.dll
    Syntax
    public class Segment<T> : IEquatable<Segment<T>>, IList<T>
    Type Parameters
    Name Description
    T

    The segment elements type.

    Тип элементов сегмента.

    Constructors

    | Improve this Doc View Source

    Segment(IList<T>, Int32, Int32)

    Initializes a new instance of the class, using the base list, offset of the segment and its length.

    Инициализирует новый экземпляр класса , используя список base, offset сегмента и его length.

    Declaration
    public Segment(IList<T> base, int offset, int length)
    Parameters
    Type Name Description
    IList<T> base

    The reference to the original list containing the elements of this segment.

    Ссылка на исходный список в котором находятся элементы этого сегмента.

    Int32 offset

    The offset relative to the base list from which the segment starts.

    Смещение относительно списка base, с которого начинается сегмент.

    Int32 length

    The segment's length.

    Длина сегмента.

    Properties

    | Improve this Doc View Source

    Base

    Gets the original list (this segment is a part of it).

    Возвращает исходный список (частью которого является этот сегмент).

    Declaration
    public IList<T> Base { get; }
    Property Value
    Type Description
    IList<T>
    | Improve this Doc View Source

    Count

    Gets the number of elements contained in the .

    Возвращает число элементов, содержащихся в .

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    Int32

    The number of elements contained in the .

    Число элементов, содержащихся в .

    | Improve this Doc View Source

    IsReadOnly

    Gets a value indicating whether the is read-only.

    Возвращает значение, указывающее, является ли доступным только для чтения.

    Declaration
    public bool IsReadOnly { get; }
    Property Value
    Type Description
    Boolean

    true if the is read-only; otherwise, false.

    Значение true, если доступен только для чтения, в противном случае — значение false.

    Remarks

    Any is read-only.

    Любой доступен только для чтения.

    | Improve this Doc View Source

    Item[Int32]

    The value.

    Declaration
    public T this[int i] { get; set; }
    Parameters
    Type Name Description
    Int32 i
    Property Value
    Type Description
    T
    | Improve this Doc View Source

    Length

    Gets the length of a segment.

    Возвращает длину сегмента.

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

    Offset

    Gets the offset relative to the source list (the index at which this segment starts).

    Возвращает смещение относительного исходного списка (индекс с которого начинается этот сегмент).

    Declaration
    public int Offset { get; }
    Property Value
    Type Description
    Int32

    Methods

    | Improve this Doc View Source

    Add(T)

    Adds an item to the .

    Добавляет элемент в .

    Declaration
    public void Add(T item)
    Parameters
    Type Name Description
    T item

    The element to add to the .

    Элемент, добавляемый в .

    | Improve this Doc View Source

    Clear()

    Removes all items from the .

    Удаляет все элементы из .

    Declaration
    public void Clear()
    | Improve this Doc View Source

    Contains(T)

    Determines whether the contains a specific value.

    Определяет, содержит ли определенное значение.

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

    The value to locate in the .

    Значение, которое нужно найти в .

    Returns
    Type Description
    Boolean

    true if the value is found in the ; otherwise, false.

    Значение true, если значение находится в ; в противном случае - false.

    | Improve this Doc View Source

    CopyTo(T[], Int32)

    Copies the elements of the into an array, starting at a specific array index.

    Копирует элементы в массив, начиная с определенного индекса массива.

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

    A one-dimensional array that is the destination of the elements copied from

    Одномерный массив, который является местом назначения элементов, скопированных из .

    Int32 arrayIndex

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

    Отсчитываемый от нуля индекс в массиве array, с которого начинается копирование.

    | Improve this Doc View Source

    Equals(Segment<T>)

    Declaration
    public virtual bool Equals(Segment<T> other)
    Parameters
    Type Name Description
    Segment<T> other
    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    Equals(Object)

    Determines whether this instance equals.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    The obj.

    Returns
    Type Description
    Boolean

    The bool

    | Improve this Doc View Source

    GetEnumerator()

    Gets an enumerator that iterates through a .

    Возвращает перечислитель, который осуществляет итерацию по .

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

    An IEnumerator object that can be used to iterate through the the .

    Объект IEnumerator, который можно использовать для перебора .

    | Improve this Doc View Source

    GetHashCode()

    Gets the hash code of the current instance.

    Возвращает хэш-код текущего экземпляра .

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32
    | Improve this Doc View Source

    IndexOf(T)

    Determines the index of a specific item in the .

    Определяет индекс конкретного элемента в .

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

    The object to locate in the .

    Элемент для поиска в .

    Returns
    Type Description
    Int32

    The index of item if found in the segment; otherwise, -1.

    Индекс item, если он найден в сегменте; в противном случае — значение -1.

    | Improve this Doc View Source

    Insert(Int32, T)

    Inserts an item to the at the specified index.

    Вставляет элемент в по указанному индексу.

    Declaration
    public void Insert(int index, T item)
    Parameters
    Type Name Description
    Int32 index

    The zero-based index at which item should be inserted.

    Отсчитываемый от нуля индекс, по которому следует вставить элемент item.

    T item

    The element to insert into the .

    Элемент, вставляемый в .

    | Improve this Doc View Source

    Remove(T)

    Removes the first occurrence of a specific value from the .

    Удаляет первое вхождение указанного значения из .

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

    The value to remove from the .

    Значение, которые нужно удалить из .

    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    RemoveAt(Int32)

    Removes the item at the specified index.

    Удаляет элемент по указанному индексу.

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    Int32 index

    The zero-based index of the item to remove.

    Отсчитываемый от нуля индекс элемента для удаления.

    Implements

    IList<>
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX