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