/ropes-1.2.5/src/org/ahmadsoft/ropes/ |
H A D | RopeBuilder.java | 39 public Rope build(final char[] sequence) {
48 public Rope build(final CharSequence sequence) {
49 if (sequence instanceof Rope)
50 return (Rope) sequence;
|
H A D | Rope.java | 2 * Rope.java
39 * Rope operations, unlike string operations, scale well to very
63 /*@ pure @*/ public interface Rope extends CharSequence, Iterable<Character>, Comparable<CharSequence>, Serializable {
interface in inherits:CharSequence,Iterable,Comparable,Serializable 77 Rope append(char c);
87 Rope append(CharSequence suffix);
99 Rope append(CharSequence csq, int start, int end);
117 Rope delete(int start, int end);
122 * in the character sequence represented by this <code>Rope</code>
142 * represented by this <code>Rope</code> object, then the index of the
204 * @return a reference to the new Rope [all...] |
/ropes-1.2.5/src/org/ahmadsoft/ropes/impl/ |
H A D | FlatRope.java | 29 interface FlatRope extends org.ahmadsoft.ropes.Rope {
|
H A D | RopeUtilities.java | 29 import org.ahmadsoft.ropes.Rope;
50 public Rope autoRebalance(final Rope r) {
65 Rope concatenate(final Rope left, final Rope right) {
101 byte depth(final Rope r) {
110 boolean isBalanced(final Rope r) {
116 public Rope rebalance(final Rope [all...] |
H A D | SerializedRope.java | 31 import org.ahmadsoft.ropes.Rope;
49 private Rope rope;
61 public SerializedRope(final Rope rope) {
70 this.rope = Rope.BUILDER.build(in.readUTF());
|
H A D | ConcatenationRopeReverseIteratorImpl.java | 28 import org.ahmadsoft.ropes.Rope;
40 private final ArrayDeque<Rope> toTraverse;
41 private final Rope rope;
42 private Rope currentRope;
48 public ConcatenationRopeReverseIteratorImpl(final Rope rope) {
52 public ConcatenationRopeReverseIteratorImpl(final Rope rope, final int start) {
54 this.toTraverse = new ArrayDeque<Rope>();
60 throw new IllegalArgumentException("Rope index out of range: " + start);
138 throw new UnsupportedOperationException("Rope iterator is read-only.");
|
H A D | AbstractRope.java | 33 import org.ahmadsoft.ropes.Rope;
39 public abstract class AbstractRope implements Rope {
44 public Rope append(final char c) {
45 return RopeUtilities.INSTANCE.concatenate(this, Rope.BUILDER.build(String.valueOf(c)));
49 public Rope append(final CharSequence suffix) {
50 return RopeUtilities.INSTANCE.concatenate(this, Rope.BUILDER.build(suffix));
54 public Rope append(final CharSequence csq, final int start, final int end) {
55 return RopeUtilities.INSTANCE.concatenate(this, Rope.BUILDER.build(csq).subSequence(start, end));
72 public Rope delete(final int start, final int end) {
86 if (other instanceof Rope) {
[all...] |
H A D | ConcatenationRopeIteratorImpl.java | 28 import org.ahmadsoft.ropes.Rope;
40 private final ArrayDeque<Rope> toTraverse;
41 private Rope currentRope;
47 public ConcatenationRopeIteratorImpl(final Rope rope) {
51 public ConcatenationRopeIteratorImpl(final Rope rope, final int start) {
52 this.toTraverse = new ArrayDeque<Rope>();
58 throw new IllegalArgumentException("Rope index out of range: " + start);
139 throw new UnsupportedOperationException("Rope iterator is read-only.");
|
H A D | ConcatenationRope.java | 29 import org.ahmadsoft.ropes.Rope;
37 private final Rope left;
38 private final Rope right;
47 public ConcatenationRope(final Rope left, final Rope right) {
57 throw new IndexOutOfBoundsException("Rope index out of range: " + index);
79 private CharSequence getForSequentialAccess(final Rope rope) {
92 System.out.println("Rope length is: " + rope.length() + " charAt is " + index);
123 public Rope getLeft() {
131 public Rope getRigh [all...] |
H A D | ReverseRope.java | 29 import org.ahmadsoft.ropes.Rope;
38 private final Rope rope;
48 public ReverseRope(final Rope rope) {
65 throw new IndexOutOfBoundsException("Rope index out of range: " + start);
80 throw new UnsupportedOperationException("Rope iterator is read-only.");
91 public Rope reverse() {
97 throw new IndexOutOfBoundsException("Rope index out of range: " + start);
112 throw new UnsupportedOperationException("Rope iterator is read-only.");
118 public Rope subSequence(final int start, final int end) {
132 throw new IndexOutOfBoundsException("Rope inde [all...] |
H A D | SubstringRope.java | 29 import org.ahmadsoft.ropes.Rope;
54 throw new IndexOutOfBoundsException("Rope index out of range: " + index);
72 public Rope getRope() {
79 throw new IndexOutOfBoundsException("Rope index out of range: " + start);
110 public Rope reverse() {
117 throw new IndexOutOfBoundsException("Rope index out of range: " + start);
141 public Rope subSequence(final int start, final int end) {
|
H A D | FlatCharSequenceRope.java | 31 import org.ahmadsoft.ropes.Rope;
62 throw new IndexOutOfBoundsException("Rope index out of range: " + start);
77 throw new UnsupportedOperationException("Rope iterator is read-only.");
94 public Rope reverse() {
101 throw new IndexOutOfBoundsException("Rope index out of range: " + start);
116 throw new UnsupportedOperationException("Rope iterator is read-only.");
122 public Rope subSequence(final int start, final int end) {
149 throw new IndexOutOfBoundsException("Rope index out of bounds:" + (offset < 0 ? offset: offset + length));
|
H A D | FlatCharArrayRope.java | 30 import org.ahmadsoft.ropes.Rope;
93 throw new IndexOutOfBoundsException("Rope index out of range: " + fromIndex);
148 throw new IndexOutOfBoundsException("Rope index out of range: " + start);
163 throw new UnsupportedOperationException("Rope iterator is read-only.");
174 public Rope reverse() {
181 throw new IndexOutOfBoundsException("Rope index out of range: " + start);
196 throw new UnsupportedOperationException("Rope iterator is read-only.");
202 public Rope subSequence(final int start, final int end) {
|
/ropes-1.2.5/src/org/ahmadsoft/ropes/test/ |
H A D | RopeTest.java | 38 import org.ahmadsoft.ropes.Rope;
46 private String fromRope(Rope rope, int start, int end) {
59 Rope rope = Rope.BUILDER.build(s.toCharArray()); // bugs
67 rope = Rope.BUILDER.build(s); // no bugs
78 Rope r = Rope.BUILDER.build("");
98 Rope x1 = Rope.BUILDER.build("01");
111 Rope x [all...] |
H A D | PerformanceTest.java | 39 import org.ahmadsoft.ropes.Rope;
60 private static Rope complexRope=null;
105 stat(System.out, stats2, "ns", "[Rope]");
131 stat(System.out, stats2, "ns", "[Rope]");
158 stat(System.out, stats2, "ns", "[Rope]");
188 stat(System.out, stats2, "ns", "[Rope]");
214 stat(System.out, stats2, "ns", "[Rope]");
236 stat(System.out, stats2, "ns", "[Rope/charAt]");
237 stat(System.out, stats3, "ns", "[Rope/itr]");
260 stat(System.out, stats2, "ns", "[Rope/charA [all...] |
/ropes-1.2.5/ |
H A D | ropes.jar | META-INF/ META-INF/MANIFEST.MF org/ org/ahmadsoft/ org/ahmadsoft/ropes/ org/ahmadsoft/ropes/impl/ ... |