Class LinkedList<T>
A linked list.
Inheritance
System.Object
LinkedList<T>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class LinkedList<T>
where T : class
Type Parameters
Name | Description |
---|---|
T |
Properties
Count
Gets the number of items in this linked list.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
First
Gets the first node in the linked list.
Declaration
public LinkedListNode<T> First { get; }
Property Value
Type | Description |
---|---|
LinkedListNode<T> |
Last
Gets the last node in the linked list.
Declaration
public LinkedListNode<T> Last { get; }
Property Value
Type | Description |
---|---|
LinkedListNode<T> |
Methods
AddAfterNode(LinkedListNode<T>, T)
Adds an item after a node.
Declaration
public LinkedListNode<T> AddAfterNode(LinkedListNode<T> node, T value)
Parameters
Type | Name | Description |
---|---|---|
LinkedListNode<T> | node | The node after which to add the value. |
T | value | The value. |
Returns
Type | Description |
---|---|
LinkedListNode<T> |
AddBeforeNode(LinkedListNode<T>, T)
Adds an item before a node.
Declaration
public LinkedListNode<T> AddBeforeNode(LinkedListNode<T> node, T value)
Parameters
Type | Name | Description |
---|---|---|
LinkedListNode<T> | node | The node before which to add the value. |
T | value | The value. |
Returns
Type | Description |
---|---|
LinkedListNode<T> |
AddFirst(T)
Adds an item to the beginning of the linked list.
Declaration
public LinkedListNode<T> AddFirst(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value. |
Returns
Type | Description |
---|---|
LinkedListNode<T> |
AddLast(T)
Adds an item to the end of the linked list.
Declaration
public LinkedListNode<T> AddLast(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value. |
Returns
Type | Description |
---|---|
LinkedListNode<T> |
Clear()
Clears all nodes from the linked list.
Declaration
public void Clear()
GetEnumerator()
Gets the enumerator for this linked list.
Declaration
public LinkedListEnumerator<T> GetEnumerator()
Returns
Type | Description |
---|---|
LinkedListEnumerator<T> |
Remove(T)
Removes an item from the linked list.
Declaration
public bool Remove(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
RemoveFirst()
Removes the first item in the linked list.
Declaration
public bool RemoveFirst()
Returns
Type | Description |
---|---|
System.Boolean |
RemoveLast()
Removes the last item in the linked list.
Declaration
public bool RemoveLast()
Returns
Type | Description |
---|---|
System.Boolean |
RemoveNode(LinkedListNode<T>)
Removes a specific node from the linked list.
Declaration
public bool RemoveNode(LinkedListNode<T> node)
Parameters
Type | Name | Description |
---|---|---|
LinkedListNode<T> | node | The node. |
Returns
Type | Description |
---|---|
System.Boolean |
ToList()
Returns the linked list as a regular list.
Declaration
public List<T> ToList()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<T> |