public IEnumerator <BatchPair> GetEnumerator() { if (_enumeration != null) { foreach (BatchPair pair in _enumeration) { yield return(pair); } } BatchPairNode node = _head; while (node != null) { yield return(node.Pair); node = node.Next; } }
public void Add(BatchPair pairToAdd) { if (pairToAdd == null) { throw new ArgumentException("Attempt to add a null pair."); } BatchPairNode newNode = new BatchPairNode(pairToAdd); if (_head == null) { _head = newNode; _tail = _head; } else { _tail.Next = newNode; _tail = newNode; } }
public void Clear() { _head = null; _tail = null; _enumeration = null; }
public BatchPairNode(BatchPair pair) { Pair = pair; Next = null; }