Show / Hide Table of Contents

Class OpenList<T>

Class that represents a generic collection that can contain queue elements at the end.

Inheritance
object
OpenList<T>
Implements
IList<T>
ICollection<T>
IEnumerable<T>
IEnumerable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TheXDS.MCART.Types
Assembly: MCART.dll
Syntax
public class OpenList<T> : IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
Name Description
T

The type of elements in the collection.

Properties

| Edit this page View Source

Count

Gets the number of elements included in this OpenList<T>.

Declaration
public int Count { get; }
Property Value
Type Description
int
| Edit this page View Source

HasTail

Gets a value indicating whether this OpenList<T> contains a queue of elements at the end.

Declaration
public bool HasTail { get; }
Property Value
Type Description
bool
| Edit this page View Source

Head

Enumerates all elements from the head of this OpenList<T>.

Declaration
public IEnumerable<T> Head { get; }
Property Value
Type Description
IEnumerable<T>
| Edit this page View Source

IsReadOnly

Gets a value indicating whether this implementation of the interface ICollection<T> is read-only.

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

For class OpenList<T>, this property always returns false.

| Edit this page View Source

this[int]

Gets or sets the element at the specified index.

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

Index of the element to get or set. A negative index refers to an element in the queue of the OpenList<T>.

Property Value
Type Description
T

The element at the specified index.

Exceptions
Type Condition
ArgumentOutOfRangeException

Occurs if index does not refer to a valid element within this OpenList<T>.

| Edit this page View Source

Tail

Enumerates all elements from the tail of this OpenList<T>.

Declaration
public IEnumerable<T> Tail { get; }
Property Value
Type Description
IEnumerable<T>

Methods

| Edit this page View Source

Add(T)

Adds an object to this OpenList<T>.

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

Object that is going to be added to this OpenList<T>. The value can be null for reference types.

| Edit this page View Source

AddTail(T)

Adds an object to the end of this OpenList<T>, ensuring that future additions via the method Add(T) will not add elements after this one.

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

Object that is going to be added to the end of this OpenList<T>. The value can be null for reference types.

| Edit this page View Source

Clear()

Removes all elements from this OpenList<T>.

Declaration
public void Clear()
| Edit this page View Source

Contains(T)

Determines whether an element is present in this OpenList<T>.

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

Object to search for in this OpenList<T>. The value can be null for reference types.

Returns
Type Description
bool

true if item is found in this OpenList<T>; otherwise, false.

| Edit this page View Source

CopyTo(T[], int)

Copies the entire contents of this OpenList<T> to a one-dimensional Array, starting at the specified index in the destination array.

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

One-dimensional Array that is the destination for the copied elements from this OpenList<T>. The Array must have zero-based indexing.

int arrayIndex

Zero-based index in array at which copying begins.

Exceptions
Type Condition
ArgumentNullException

The value of array is null.

ArgumentOutOfRangeException

arrayIndex is less than zero.

ArgumentException

The number of elements in the source OpenList<T> is greater than the available space from arrayIndex to the end of the destination array.

| Edit this page View Source

GetEnumerator()

Returns an enumerator that iterates through this OpenList<T>.

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

An IEnumerator<T> for this OpenList<T>.

| Edit this page View Source

IndexOf(T)

Determines the zero-based index of a specific element within this IList<T>.

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

Object to search for in the IList<T>.

Returns
Type Description
int

The index of item if it is found in the list; otherwise, returns -1.

| Edit this page View Source

Insert(int, T)

Inserts an element into this OpenList<T> at the specified index.

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

Index at which to insert the item.

T item

Object to insert. The value can be null for reference types.

Exceptions
Type Condition
ArgumentOutOfRangeException

Occurs if index does not refer to a valid element within this OpenList<T>.

| Edit this page View Source

JoinTail()

Moves all elements from the tail to the head of the collection.

Declaration
public void JoinTail()
| Edit this page View Source

Remove(T)

Removes the first occurrence of a specific object from this OpenList<T>.

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

Object to remove from this OpenList<T>. The value can be null for reference types.

Returns
Type Description
bool

true if the item is successfully removed; otherwise, false. This method also returns false if the item was not found in this OpenList<T>.

| Edit this page View Source

RemoveAt(int)

Removes the element at the specified index from this OpenList<T>.

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

Index of the element to remove.

Exceptions
Type Condition
ArgumentOutOfRangeException

Occurs if index does not refer to a valid element within this OpenList<T>.

| Edit this page View Source

SplitTail(int)

Separates the collection of elements into a head and a tail at the specified index.

Declaration
public void SplitTail(int index)
Parameters
Type Name Description
int index

Index of the element that will be the start of the tail.

Implements

IList<T>
ICollection<T>
IEnumerable<T>
IEnumerable

Extension Methods

CollectionExtensions.AddRangeAsync<T>(ICollection<T>, IAsyncEnumerable<T>)
CollectionExtensions.AddRange<T>(ICollection<T>, IEnumerable<T>)
CollectionExtensions.PopFirst<T>(ICollection<T>)
CollectionExtensions.Pop<T>(ICollection<T>)
CollectionExtensions.Push<TItem, TCollection>(ICollection<TCollection>)
CollectionExtensions.Push<TItem, TCollection>(ICollection<TCollection>, TItem)
CollectionExtensions.RemoveAll<T>(ICollection<T>)
CollectionExtensions.RemoveAll<T>(ICollection<T>, in Action<T>)
CollectionExtensions.RemoveAll<T>(ICollection<T>, in Predicate<T>)
CollectionExtensions.RemoveAll<T>(ICollection<T>, in Predicate<T>?, in Action<T>?)
CollectionExtensions.RemoveOf<TItem, TRemove>(ICollection<TItem>)
MvvmCollectionExtensions.ToObservable<T>(ICollection<T>)
CollectionHelpers.WithIndex<T>(IEnumerable<T>)
EnumerableExtensions.AreAllEqual<T>(IEnumerable<T>)
EnumerableExtensions.AreAllEqual<T, TProp>(IEnumerable<T>, Func<T, TProp>)
EnumerableExtensions.Copy<T>(IEnumerable<T>)
EnumerableExtensions.ExceptFor<T>(IEnumerable<T>, params T[])
EnumerableExtensions.FindIndexOf<T>(IEnumerable<T>, T)
EnumerableExtensions.FirstOf<T>(IEnumerable<T>, Type)
EnumerableExtensions.IsPropertyEqual<T>(IEnumerable<T>, Func<T, object>)
EnumerableExtensions.IsQuorum<T>(IEnumerable<T>, int, out T)
EnumerableExtensions.NonDefaults<T>(IEnumerable<T?>)
EnumerableExtensions.OfType<T>(IEnumerable<T>, Type)
EnumerableExtensions.OrNull<T>(IEnumerable<T>)
EnumerableExtensions.PickAsync<T>(IEnumerable<T>)
EnumerableExtensions.Pick<T>(IEnumerable<T>)
EnumerableExtensions.Pick<T>(IEnumerable<T>, in Random)
EnumerableExtensions.Quorum<T>(IEnumerable<T>, int)
EnumerableExtensions.Range<T>(IEnumerable<T>, int, int)
EnumerableExtensions.Rotate<T>(IEnumerable<T>, int)
EnumerableExtensions.SelectAsync<TIn, TOut>(IEnumerable<TIn>, Func<TIn, Task<TOut>>)
EnumerableExtensions.Shift<T>(IEnumerable<T>, int)
EnumerableExtensions.Shuffled<T>(IEnumerable<T>)
EnumerableExtensions.Shuffled<T>(IEnumerable<T>, in int)
EnumerableExtensions.Shuffled<T>(IEnumerable<T>, in int, in int)
EnumerableExtensions.Shuffled<T>(IEnumerable<T>, in int, in int, in int, in Random)
EnumerableExtensions.ToExtendedListAsync<T>(IEnumerable<T>)
EnumerableExtensions.ToExtendedList<T>(IEnumerable<T>)
EnumerableExtensions.ToListAsync<T>(IEnumerable<T>)
EnumerableExtensions.YieldAsync<T>(IEnumerable<T>, Func<T, Task>)
ListExtensions.ApplyRotate<T>(IList<T>, in int)
ListExtensions.ApplyShift<T>(IList<T>, in int)
ListExtensions.Shuffle<T>(IList<T>)
ListExtensions.Shuffle<T>(IList<T>, int, int, in int, Random)
ListExtensions.Shuffle<T>(IList<T>, in int)
ListExtensions.Shuffle<T>(IList<T>, in int, in int)
ListExtensions.Shuffle<T>(IList<T>, in int, in int, in int)
ListExtensions.Swap<T>(IList<T>, in int, in int)
ListExtensions.Swap<T>(IList<T>, T, T)
CollectionHelpers.ToTypes(IEnumerable)
EnumerableExtensions.Contains(IEnumerable, object?)
EnumerableExtensions.ContainsAll(IEnumerable, IEnumerable)
EnumerableExtensions.ContainsAll(IEnumerable, params object?[])
EnumerableExtensions.ContainsAny(IEnumerable, IEnumerable)
EnumerableExtensions.ContainsAny(IEnumerable, params object?[])
EnumerableExtensions.Count(IEnumerable)
EnumerableExtensions.FirstOf<T>(IEnumerable)
EnumerableExtensions.GroupByType(IEnumerable)
EnumerableExtensions.IsAnyOf(IEnumerable, Type)
EnumerableExtensions.IsAnyOf<T>(IEnumerable)
EnumerableExtensions.ItemsEqual(IEnumerable, IEnumerable)
EnumerableExtensions.NotNull(IEnumerable?)
EnumerableExtensions.NullCount(IEnumerable)
EnumerableExtensions.ToGeneric(IEnumerable)
Objects.ShallowCopyTo(object, object, Type)
ObjectExtensions.FieldsOf<T>(object)
ObjectExtensions.GetAttribute<T>(object)
ObjectExtensions.GetAttributes<T>(object)
ObjectExtensions.HasAttrValue<TAttribute, TValue>(object, out TValue)
ObjectExtensions.HasAttribute<T>(object)
ObjectExtensions.HasAttribute<T>(object, out T?)
ObjectExtensions.HasAttributes<T>(object, out IEnumerable<T>?)
ObjectExtensions.Is(object?, object?)
ObjectExtensions.IsEither(object, IEnumerable)
ObjectExtensions.IsEither(object, params object[])
ObjectExtensions.IsNeither(object, IEnumerable)
ObjectExtensions.IsNeither(object, params object[])
ObjectExtensions.IsNot(object?, object?)
ObjectExtensions.PropertiesOf<T>(object)
ObjectExtensions.WhichAre(object, IEnumerable<object>)
ObjectExtensions.WhichAre(object, params object[])
Common.IfNotNull<T>(T?, Action<T>)
Objects.Itself<T>(T)
Objects.ShallowClone<T>(T)
Objects.ShallowCopyTo<T>(T, T)
CollectionExtensions.PushInto<TItem, TCollection>(TItem, ICollection<TCollection>)
DictionaryExtensions.PushInto<TKey, TValue>(TValue, TKey, IDictionary<TKey, TValue>)
EnumerableExtensions.Locked<T>(T, Action<T>)
EnumerableExtensions.Locked<T, TResult>(T, Func<T, TResult>)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX