Exemplo n.º 1
0
 public eeListNode(eeObject obj, eeNumber index, eeListNode prev, eeListNode next)
 {
     this.obj   = obj;
     this.index = index;
     this.prev  = prev;
     this.next  = next;
 }
Exemplo n.º 2
0
        private IEnumerable <eeListNode> Iterate()
        {
            eeListNode currNode = this.HeadNode;

            while (currNode != null)
            {
                yield return(currNode);

                currNode = currNode.next;
            }
        }
Exemplo n.º 3
0
        public void Append(eeObject obj)
        {
            _count += eeNumber.ONE;
            if (LastNode == null) // if this is the second object to enter the list
            {
                var node = new eeListNode(obj.Copy(), _count.Copy(), HeadNode, null);
                LastNode      = node;
                HeadNode.next = node;
                return;
            }

            var newNode = new eeListNode(obj.Copy(), _count.Copy(), LastNode, null);

            this.LastNode.next = newNode;
            this.LastNode      = newNode;
        }
Exemplo n.º 4
0
        public eeList(eeObject firstObject)
        {
            var firstNode = new eeListNode(firstObject, _count.Copy(), null, null);

            this.HeadNode = firstNode;
        }