Пример #1
0
 internal Rope(RopeNode <T> root)
 {
     this.root = root;
     root.CheckInvariants();
 }
Пример #2
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
     root = RopeNode <T> .emptyRopeNode;
     root.CheckInvariants();
 }
Пример #3
0
 /// <summary>
 ///     Resets the rope to an empty list.
 ///     Runs in O(1).
 /// </summary>
 public void Clear()
 {
     root = RopeNode <T> .emptyRopeNode;
     OnChanged();
 }