Пример #1
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);
     }
 }
Пример #2
0
 public LinkedListToken setStopToken(LinkedListToken stopToken)
 {
     if (parent != null)
     {
         parent.notifyChildStopTokenChange(this, stopToken);
     }
     return(this.stopToken = stopToken);
 }
Пример #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);
     }
 }
Пример #4
0
 public void setStartToken(LinkedListToken startToken)
 {
     if (parent != null)
     {
         parent.notifyChildStartTokenChange(this, startToken);
     }
     this.startToken = startToken;
 }
Пример #5
0
 public void setPrev(LinkedListToken prev)
 {
     if (this == prev)
     {
         throw new ArgumentException("Token stream loop detected");
     }
     this.prev = prev;
     if (prev != null)
     {
         prev.next = this;
     }
 }
Пример #6
0
 public void setNext(LinkedListToken next)
 {
     if (this == next)
     {
         throw new ArgumentException("Token stream loop detected (" + ToString() + ")");
     }
     this.next = next;
     if (next != null)
     {
         next.prev = this;
     }
 }
Пример #7
0
 public void delete()
 {
     if (prev != null)
     {
         prev.next = next;
     }
     if (next != null)
     {
         next.prev = prev;
     }
     next = prev = null;
 }
Пример #8
0
 public void beforeInsert(LinkedListToken insert)
 {
     if (insert.getPrev() != null)
     {
         throw new ArgumentException("beforeInsert(" + insert + ") : prev was not null");
     }
     if (insert.getNext() != null)
     {
         throw new ArgumentException("beforeInsert(" + insert + ") : next was not null");
     }
     insert.prev = prev;
     insert.next = this;
     if (prev != null)
     {
         prev.next = insert;
     }
     prev = insert;
 }
Пример #9
0
 public void afterInsert(LinkedListToken insert)
 {
     if (insert.getPrev() != null)
     {
         throw new ArgumentException("afterInsert(" + insert + ") : prev was not null");
     }
     if (insert.getNext() != null)
     {
         throw new ArgumentException("afterInsert(" + insert + ") : next was not null");
     }
     insert.next = next;
     insert.prev = this;
     if (next != null)
     {
         next.prev = insert;
     }
     next = insert;
 }
Пример #10
0
 public void setInitialInsertionBefore(LinkedListToken insert)
 {
     initialInsertionBefore = insert;
 }
Пример #11
0
 public void setInitialInsertionAfter(LinkedListToken insert)
 {
     initialInsertionAfter = insert;
 }
Пример #12
0
 public void addToken(int index, LinkedListToken append)
 {
     tokenListUpdater.AddToken(this, index, append);
 }
Пример #13
0
 public void appendToken(LinkedListToken append)
 {
     tokenListUpdater.AppendToken(this, append);
 }