Beispiel #1
0
        public void Append(string s)
        {
            ChainListNode <string> node = new ChainListNode <string>(s);

            this.chainList.Add(node);

            this.length += s.Length;
        }
Beispiel #2
0
        public void Append(ChainList <T> chainList)
        {
            if (this.head == null)
            {
                this.head = chainList.head;
                this.tail = chainList.tail;

                return;
            }

            this.tail.Next = chainList.head;
            this.tail      = chainList.tail;
        }
Beispiel #3
0
        public void Add(ChainListNode <T> node)
        {
            if (this.head == null)
            {
                this.head = node;
                this.tail = node;

                return;
            }

            this.tail.Next = node;
            this.tail      = node;
        }
Beispiel #4
0
        public bool MoveNext()
        {
            if (this.current == null)
            {
                if (this.head == null)
                {
                    return(false);
                }

                this.current = this.head;
                return(true);
            }

            if (this.current.Next == null)
            {
                return(false);
            }

            this.current = this.current.Next;
            return(true);
        }