Esempio n. 1
0
 /// <summary>
 /// Creates a new rope representing the empty string.
 /// </summary>
 public Rope()
 {
     // we'll construct the empty rope as a clone of an imaginary static empty rope
     this.root = RopeNode <T> .emptyRopeNode;
     root.CheckInvariants();
 }
Esempio n. 2
0
 internal Rope(RopeNode <T> root)
 {
     this.root = root;
     root.CheckInvariants();
 }
Esempio n. 3
0
 internal RopeCacheEntry(RopeNode <T> node, int nodeStartOffset)
 {
     this.node           = node;
     this.nodeStartIndex = nodeStartOffset;
 }
Esempio n. 4
0
 /// <summary>
 /// Resets the rope to an empty list.
 /// Runs in O(1).
 /// </summary>
 public void Clear()
 {
     root = RopeNode <T> .emptyRopeNode;
     OnChanged();
 }