コード例 #1
0
        private void SetHeadItem(T data)
        {
            var item = new DuplexItem <T>(data);

            head  = item;
            tail  = item;
            Count = 1;
        }
コード例 #2
0
        public void PushFront(T data)
        {
            if (Count == 0)
            {
                SetHeadItem(data);
                return;
            }

            var item = new DuplexItem <T>(data);

            item.Previous = head;
            tail.Next     = item;
            head          = item;
            Count++;
        }
コード例 #3
0
        public void PushBack(T data)
        {
            if (Count == 0)
            {
                SetHeadItem(data);
                return;
            }

            var item = new DuplexItem <T>(data);

            item.Next     = tail;
            tail.Previous = item;
            tail          = item;
            Count++;
        }