M42.Collections by Daniel Pelsmaeker

<PackageReference Include="M42.Collections" Version="0.6.5056.5071" />

 CircularSequence<T>

A circular sequence of elements.
protected const int MinimumCapacity = 8

The minimum capacity.

public int Capacity { get; }

Gets the capacity of this circular queue.

public IEqualityComparer<T> Comparer { get; }

Gets the equality comparer used to compare elements in this list.

public int Count { get; }

public bool IsEmpty { get; }

public T this[int index] { get; }

Initializes a new instance of the CircularSequence<T> class.

public CircularSequence(IEqualityComparer<T> comparer)

Initializes a new instance of the CircularSequence<T> class.

public CircularSequence(int minimumCapacity)

Initializes a new instance of the CircularSequence<T> class.

public CircularSequence(int minimumCapacity, IEqualityComparer<T> comparer)

Initializes a new instance of the CircularSequence<T> class.

public bool Add(T value)

Adds a value to the end of the sequence.

protected virtual bool AddElement(T element)

Adds a value to the sequence.

protected bool AddFirst(T value)

Adds a value to the start of the sequence.

protected bool AddLast(T value)

Adds a value to the end of the sequence.

public void Clear()

Removes all elements from the circular sequence.

public bool Contains(object value)

public T Dequeue()

Removes and returns the first element in the sequence.

protected void EnsureCapacity(int minimumCapacity)

Ensures that the circular array has at least the specified capacity.

public T GetMember(object value, out bool isPresent)

public T GetMember(object value)

public int? IndexOf(object value)

public virtual bool IsValidMember(object value)

public T Peek()

protected virtual T PeekElement()

Returns the element that would be returned by the next call to TakeElement, without actually removing the element.

protected T PeekFirst()

Returns the first element from the sequence.

protected T PeekLast()

Returns the last element from the sequence.

public T Pop()

Removes and returns the last element in the sequence.

protected virtual T TakeElement()

Takes and returns the element from the sequence.

protected T TakeFirst()

Removes and returns the first element from the sequence.

protected T TakeLast()

Removes and returns the last element from the sequence.