/// <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(); }
internal Rope(RopeNode <T> root) { this.root = root; root.CheckInvariants(); }
internal RopeCacheEntry(RopeNode <T> node, int nodeStartOffset) { this.node = node; this.nodeStartIndex = nodeStartOffset; }
/// <summary> /// Resets the rope to an empty list. /// Runs in O(1). /// </summary> public void Clear() { root = RopeNode <T> .emptyRopeNode; OnChanged(); }