public bool Remove(T value) { BetterLinkedListNode <T> node = Find(value); Remove(node); return(node != null); }
public BetterLinkedListNode <T> AddLast(T value) { BetterLinkedListNode <T> newNode = BetterLinkedListNode <T> .Get(); newNode.InitInfo(this, value); mLinkedList.AddLast(newNode.Node); return(newNode); }
public BetterLinkedListNode <T> AddBefore(BetterLinkedListNode <T> node, T value) { BetterLinkedListNode <T> newNode = BetterLinkedListNode <T> .Get(); newNode.InitInfo(this, value); mLinkedList.AddBefore(node.Node, newNode.Node); return(newNode); }
public void Remove(BetterLinkedListNode <T> node) { if (node != null) { mLinkedList.Remove(node.Node); node.Release(); } }
public void CopyTo(T[] array, int index) { BetterLinkedListNode <T> node = First; while (node != null && index < Count) { array[index++] = node.Value; node = node.Next; } }
static public BetterLinkedListNode <T> Get() { BetterLinkedListNode <T> node = s_cachePool.New(); if (node != null) { node.List = default(BetterLinkedList <T>); node.Value = default(T); } return(node); }
public void Clear() { BetterLinkedListNode <T> node = First; while (node != null) { node.Release(); node = node.Next; } mLinkedList.Clear(); }
public bool MoveNext() { if (node == null) { node = head; } else { node = node.Next; } return(node != null); }
public BetterLinkedListNode <T> FindLast(T value) { BetterLinkedListNode <T> node = Last; EqualityComparer <T> comp = EqualityComparer <T> .Default; while (node != null) { if (comp.Equals(node.Value, value)) { return(node); } node = node.Previous; } return(null); }
public BetterLinkedListNodeData(BetterLinkedListNode <T> holder, T value) { Holder = holder; Value = value; }
public void AddLast(BetterLinkedListNode <T> node) { mLinkedList.AddLast(node.Node); }
public void AddBefore(BetterLinkedListNode <T> node, BetterLinkedListNode <T> newNode) { mLinkedList.AddBefore(node.Node, newNode.Node); }
public void AddAfter(BetterLinkedListNode <T> node, BetterLinkedListNode <T> newNode) { mLinkedList.AddAfter(node.Node, newNode.Node); }
void IEnumerator.Reset() { node = null; }
internal NodeEnumerator(BetterLinkedListNode <T> node) { this.head = node; this.node = null; }