Class OpenList<T>
Class that represents a generic collection that can contain queue elements at the end.
Inherited Members
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 SourceCount
Gets the number of elements included in this OpenList<T>.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
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 |
Head
Enumerates all elements from the head of this OpenList<T>.
Declaration
public IEnumerable<T> Head { get; }
Property Value
Type | Description |
---|---|
IEnumerable<T> |
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. |
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 |
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 SourceAdd(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. |
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. |
Clear()
Removes all elements from this OpenList<T>.
Declaration
public void Clear()
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. |
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 |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The value of |
ArgumentOutOfRangeException |
|
ArgumentException | The number of elements in the source OpenList<T> is greater than
the available space from |
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>. |
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 |
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 |
T | item | Object to insert. The value can be null for reference types. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Occurs if |
JoinTail()
Moves all elements from the tail to the head of the collection.
Declaration
public void JoinTail()
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 |
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 |
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. |