Exemple #1
0
        public void setChildWithTokens(int index, LinkedListTree child)
        {
            LinkedListTree oldChild = (LinkedListTree)GetChild(index);

            setChild(index, child);
            tokenListUpdater.ReplacedChild(this, index, child, oldChild);
        }
Exemple #2
0
 /**
  * called when one of this node's children updates it's stop-token,
  * so that this node can potentially take action; maybe by setting
  * the same stop-token IF the child was the very-last in this node's
  * list of children.
  */
 private void notifyChildStopTokenChange(LinkedListTree child, LinkedListToken newStop)
 {
     // TODO: maybe move to delegates
     if (isLast(child) && (isSameStopToken(child) || isNoStopToken(child)))
     {
         setStopToken(newStop);
     }
 }
Exemple #3
0
 /**
  * called when one of this node's children updates it's start-token,
  * so that this node can potentially take action; maybe by setting
  * the same start-token IF the child was the very-first in this node's
  * list of children.
  */
 private void notifyChildStartTokenChange(LinkedListTree child, LinkedListToken newStart)
 {
     // TODO: maybe move to delegates
     if (isFirst(child) && isSameStartToken(child))
     {
         setStartToken(newStart);
     }
 }
Exemple #4
0
        public BaseTree deleteChild(int index)
        {
            LinkedListTree result = (LinkedListTree)base.DeleteChild(index);

            tokenListUpdater.DeletedChild(this, index, result);
            result.Parent = null;
            return(result);
        }
Exemple #5
0
 public void addChildWithTokens(int index, LinkedListTree child)
 {
     if (Children == null)
     {
         CreateChildrenList();
     }
     Children.Add(child);
     if (child != null)
     {
         child.Parent = this;
     }
     tokenListUpdater.AddedChild(this, index, child);
 }
Exemple #6
0
 public void setChildWithTokens(int index, LinkedListTree child)
 {
     LinkedListTree oldChild = (LinkedListTree)GetChild(index);
     setChild(index, child);
     tokenListUpdater.ReplacedChild(this, index, child, oldChild);
 }
Exemple #7
0
 public int getIndexOfChild(LinkedListTree child)
 {
     return Children.IndexOf(child);
 }
Exemple #8
0
 public void addChildWithTokens(int index, LinkedListTree child)
 {
     if (Children == null)
     {
         CreateChildrenList();
     }
     Children.Add(child);
     if (child != null)
     {
         child.Parent = this;
     }
     tokenListUpdater.AddedChild(this, index, child);
 }
Exemple #9
0
 /**
  * Adds the given child node to the end of the list of children
  * maintanined by the given parent node, and inserts the tokens
  * belonging to child into the tokenlist of parent just after the
  * stop-token of the previous last child.
  */
 public void addChildWithTokens(LinkedListTree child)
 {
     addChild(child);
     tokenListUpdater.AddedChild(this, child);
 }
Exemple #10
0
 /**
  * Adds the given child node to the end of the list of children
  * maintanined by the given parent node, and inserts the tokens
  * belonging to child into the tokenlist of parent just after the
  * stop-token of the previous last child.
  */
 public void addChildWithTokens(LinkedListTree child)
 {
     addChild(child);
     tokenListUpdater.AddedChild(this, child);
 }
Exemple #11
0
 /**
  * called when one of this node's children updates it's stop-token,
  * so that this node can potentially take action; maybe by setting
  * the same stop-token IF the child was the very-last in this node's
  * list of children.
  */
 private void notifyChildStopTokenChange(LinkedListTree child, LinkedListToken newStop)
 {
     // TODO: maybe move to delegates
     if (isLast(child) && (isSameStopToken(child) || isNoStopToken(child)))
     {
         setStopToken(newStop);
     }
 }
Exemple #12
0
 private bool isSameStopToken(LinkedListTree child)
 {
     return child.getStopToken() == getStopToken();
 }
Exemple #13
0
 private bool isNoStopToken(LinkedListTree child)
 {
     return(child.getStopToken() == null);
 }
Exemple #14
0
 private bool isLast(LinkedListTree child)
 {
     return child == getLastChild();
 }
Exemple #15
0
 private bool isSameStopToken(LinkedListTree child)
 {
     return(child.getStopToken() == getStopToken());
 }
Exemple #16
0
 private bool isNoStopToken(LinkedListTree child)
 {
     return child.getStopToken() == null;
 }
Exemple #17
0
 private bool isLast(LinkedListTree child)
 {
     return(child == getLastChild());
 }
Exemple #18
0
 /**
  * called when one of this node's children updates it's start-token,
  * so that this node can potentially take action; maybe by setting
  * the same start-token IF the child was the very-first in this node's
  * list of children.
  */
 private void notifyChildStartTokenChange(LinkedListTree child, LinkedListToken newStart)
 {
     // TODO: maybe move to delegates
     if (isFirst(child) && isSameStartToken(child))
     {
         setStartToken(newStart);
     }
 }
Exemple #19
0
 public LinkedListTree(LinkedListTree node)
     : base(node)
 {
     this.token = node.token;
 }
Exemple #20
0
 public LinkedListTree(LinkedListTree node)
     : base(node)
 {
     this.token = node.token;
 }
Exemple #21
0
 public int getIndexOfChild(LinkedListTree child)
 {
     return(Children.IndexOf(child));
 }