Exemple #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);
     }
 }
Exemple #2
0
 public LinkedListToken setStopToken(LinkedListToken stopToken)
 {
     if (parent != null)
     {
         parent.notifyChildStopTokenChange(this, stopToken);
     }
     return(this.stopToken = stopToken);
 }
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 void setStartToken(LinkedListToken startToken)
 {
     if (parent != null)
     {
         parent.notifyChildStartTokenChange(this, startToken);
     }
     this.startToken = startToken;
 }
Exemple #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;
     }
 }
Exemple #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;
     }
 }
Exemple #7
0
 public void delete()
 {
     if (prev != null)
     {
         prev.next = next;
     }
     if (next != null)
     {
         next.prev = prev;
     }
     next = prev = null;
 }
Exemple #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;
 }
Exemple #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;
 }
Exemple #10
0
 public void setInitialInsertionBefore(LinkedListToken insert)
 {
     initialInsertionBefore = insert;
 }
Exemple #11
0
 public void setInitialInsertionAfter(LinkedListToken insert)
 {
     initialInsertionAfter = insert;
 }
Exemple #12
0
 public void addToken(int index, LinkedListToken append)
 {
     tokenListUpdater.AddToken(this, index, append);
 }
Exemple #13
0
 public void appendToken(LinkedListToken append)
 {
     tokenListUpdater.AppendToken(this, append);
 }