Class NodeList
- Namespace
- Lime
- Assembly
- Lime.dll
public class NodeList : IList<Node>, ICollection<Node>, IEnumerable<Node>, IList, ICollection, IEnumerable
- Inheritance
-
NodeList
- Implements
- Inherited Members
- Extension Methods
Constructors
NodeList(Node)
public NodeList(Node owner)
Parameters
owner
Node
Properties
Count
Gets the number of elements contained in the ICollection<T>.
public int Count { get; }
Property Value
- int
The number of elements contained in the ICollection<T>.
IsReadOnly
Gets a value indicating whether the ICollection<T> is read-only.
public bool IsReadOnly { get; }
Property Value
- bool
true if the ICollection<T> is read-only; otherwise, false.
this[int]
Gets or sets the element at the specified index.
public Node this[int index] { get; set; }
Parameters
index
intThe zero-based index of the element to get or set.
Property Value
- Node
The element at the specified index.
Exceptions
- ArgumentOutOfRangeException
index
is not a valid index in the IList<T>.- NotSupportedException
The property is set and the IList<T> is read-only.
Methods
Add(Node)
Adds a Node to the end of this list.
public void Add(Node node)
Parameters
node
Node
AddRange(params Node[])
public void AddRange(params Node[] collection)
Parameters
collection
Node[]
AddRange(IEnumerable<Node>)
public void AddRange(IEnumerable<Node> collection)
Parameters
collection
IEnumerable<Node>
Clear()
Removes all items from the ICollection<T>.
public void Clear()
Exceptions
- NotSupportedException
The ICollection<T> is read-only.
Contains(Node)
Determines whether the ICollection<T> contains a specific value.
public bool Contains(Node node)
Parameters
node
Node
Returns
- bool
true if
item
is found in the ICollection<T>; otherwise, false.
CopyTo(Node[], int)
Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.
public void CopyTo(Node[] array, int index)
Parameters
array
Node[]The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing.
index
int
Exceptions
- ArgumentNullException
array
is null.- ArgumentOutOfRangeException
arrayIndex
is less than 0.- ArgumentException
The number of elements in the source ICollection<T> is greater than the available space from
arrayIndex
to the end of the destinationarray
.
GetEnumerator()
Returns Enumerator for this list. This method is preferrable over IEnumerable.GetEnumerator() because it doesn't allocate new memory via boxing.
public NodeList.Enumerator GetEnumerator()
Returns
IndexOf(Node)
Determines the index of a specific item in the IList<T>.
public int IndexOf(Node node)
Parameters
node
Node
Returns
- int
The index of
item
if found in the list; otherwise, -1.
Insert(int, Node)
Inserts an item to the IList<T> at the specified index.
public void Insert(int index, Node node)
Parameters
Exceptions
- ArgumentOutOfRangeException
index
is not a valid index in the IList<T>.- NotSupportedException
The IList<T> is read-only.
Move(int, int)
public void Move(int indexFrom, int indexTo)
Parameters
Push(Node)
Adds a Node to the start of this list.
public void Push(Node node)
Parameters
node
Node
Remove(Node)
Removes the first occurrence of a specific object from the ICollection<T>.
public bool Remove(Node node)
Parameters
node
Node
Returns
- bool
true if
item
was successfully removed from the ICollection<T>; otherwise, false. This method also returns false ifitem
is not found in the original ICollection<T>.
Exceptions
- NotSupportedException
The ICollection<T> is read-only.
RemoveAll(Predicate<Node>)
public void RemoveAll(Predicate<Node> predicate)
Parameters
RemoveAt(int)
Removes the IList<T> item at the specified index.
public void RemoveAt(int index)
Parameters
index
intThe zero-based index of the item to remove.
Exceptions
- ArgumentOutOfRangeException
index
is not a valid index in the IList<T>.- NotSupportedException
The IList<T> is read-only.
RemoveRange(int, int)
public void RemoveRange(int index, int count)
Parameters
Sort(Comparison<Node>)
public void Sort(Comparison<Node> comparison)
Parameters
comparison
Comparison<Node>
Swap(int, int)
public void Swap(int index1, int index2)
Parameters
TryFind(string)
Searchs for node with provided Id in this list. Returns null if this list doesn't contain sought-for node.
public Node TryFind(string id)
Parameters
id
string