Esempio n. 1
0
        public IEnumerator <T> GetEnumerator()
        {
            current = head;
            do
            {
                if (current != null)
                {
                    yield return(current.Data);

                    current = current.Next;
                }
            }while (current != head);
        }
Esempio n. 2
0
 public DoublyNode <T> Current(T data)
 {
     if (head == null)
     {
         return(null);
     }
     current = head;
     do
     {
         if (current.Data.Equals(data))
         {
             return(current);
         }
         current = current.Next;
     }while (current != head);
     return(null);
 }
Esempio n. 3
0
 public void Add(DoublyNode <T> node)
 {
     if (head == null)
     {
         head          = node;
         head.Previous = node;
         head.Next     = node;
     }
     else
     {
         node.Previous      = head.Previous;
         node.Next          = head;
         head.Previous.Next = node;
         head.Previous      = node;
     }
     count++;
 }
Esempio n. 4
0
 public void Clear()
 {
     head  = null;
     count = 0;
 }
Esempio n. 5
0
 public DoublyNode <T> MovePrevious()
 {
     current = current.Previous;
     return(current);
 }
Esempio n. 6
0
 public DoublyNode <T> MoveNext()
 {
     current = current.Next;
     return(current);
 }