Class WeakList<T>.Node
Represents a node in a WeakList<T>, which identifies the position of a value in the list.
Implements
Namespace: Singulink.Collections
Assembly: Singulink.Collections.Weak.dll
Syntax
public sealed class WeakList<T>.Node : IDisposable
Remarks
Holding a reference to a node does not prevent its value from being garbage collected. Nodes can be used to remove a value from the list in O(1) time, to add values relative to its position, or to start an enumeration from its position.
Properties
| Name | Description |
|---|---|
| IsRemoved | Gets a value indicating whether this node has been removed from the list, either explicitly or because its value was garbage collected. |
| List | Gets the list that this node belongs to. The list is still returned after the node has been removed from it. |
| Value | Gets the value of this node, or null if the value has been garbage collected. |
| Version | Gets the version of the list at the time this node was added. See Version. |
Methods
| Name | Description |
|---|---|
| Dispose() | Removes this node from the list. Does nothing if the node has already been removed. |
| TryUpdateTarget(T) | Replaces the value of this node with the specified value without changing its position in the list. |