Searched refs:length (Results 1 - 15 of 15) sorted by relevance

/ropes-1.2.5/src/org/ahmadsoft/ropes/impl/
H A DSubstringRope.java40 private final int length; field in class:SubstringRope
42 public SubstringRope(final FlatRope rope, final int offset, final int length) { argument
43 if (length < 0 || offset < 0 || offset + length > rope.length())
44 throw new IndexOutOfBoundsException("Invalid substring offset (" + offset + ") and length (" + length + ") for underlying rope with length " + rope.length());
48 this.length
105 public int length() { method in class:SubstringRope
158 write(final Writer out, final int offset, final int length) argument
[all...]
H A DFlatCharArrayRope.java46 this(sequence, 0, sequence.length);
53 * @param length the length of the array.
55 public FlatCharArrayRope(final char[] sequence, final int offset, final int length) { argument
56 if (length > sequence.length)
57 throw new IllegalArgumentException("Length must be less than " + sequence.length);
58 this.sequence = new char[length];
59 System.arraycopy(sequence, offset, this.sequence, 0, length);
79 for (int j=0; j<this.sequence.length;
169 public int length() { method in class:FlatCharArrayRope
218 toString(final int offset, final int length) argument
228 write(final Writer out, final int offset, final int length) argument
[all...]
H A DReverseRope.java54 return this.rope.charAt(this.length() - index - 1);
64 if (start < 0 || start > this.length())
70 return this.current < ReverseRope.this.length();
86 public int length() { method in class:ReverseRope
87 return this.rope.length();
96 if (start < 0 || start > this.length())
99 int current = ReverseRope.this.length() - start;
119 if (start == 0 && end == this.length())
121 return this.rope.subSequence(this.length() - end, this.length()
130 write(final Writer out, final int offset, final int length) argument
[all...]
H A DConcatenationRope.java40 private final int length; field in class:ConcatenationRope
51 this.length = left.length() + right.length();
56 if (index >= this.length())
59 return (index < this.left.length() ? this.left.charAt(index): this.right.charAt(index - this.left.length()));
92 System.out.println("Rope length is: " + rope.length() + " charAt is " + index);
107 public int length() {
147 public int length() { method in class:ConcatenationRope
195 write(final Writer out, final int offset, final int length) argument
[all...]
H A DFlatCharSequenceRope.java61 if (start < 0 || start > this.length())
67 return this.current < FlatCharSequenceRope.this.length();
83 public int length() { method in class:FlatCharSequenceRope
84 return this.sequence.length();
100 if (start < 0 || start > this.length())
103 int current = FlatCharSequenceRope.this.length() - start;
123 if (start == 0 && end == this.length())
137 public String toString(final int offset, final int length) { argument
138 return this.sequence.subSequence(offset, offset + length).toString();
143 this.write(out, 0, this.length());
147 write(final Writer out, final int offset, final int length) argument
[all...]
H A DFlatRope.java34 * @param length the length.
38 public String toString(int offset, int length); argument
H A DAbstractRope.java60 final int compareTill = Math.min(sequence.length(), this.length());
68 return this.length() - sequence.length();
75 return this.subSequence(0, start).append(this.subSequence(end, this.length()));
88 if (rope.hashCode() != this.hashCode() || rope.length() != this.length())
115 if (this.hashCode == 0 && this.length() > 0) {
116 if (this.length() < 6) {
123 this.hashCode = 31 * this.hashCode + this.charAt(this.length()
[all...]
H A DRopeUtilities.java66 if (left.length() == 0)
68 if (right.length() == 0)
70 if ((long) left.length() + right.length() > Integer.MAX_VALUE)
72 "Left length=" + left.length() + ", right length=" + right.length()
73 + ". Concatenation would overflow length field.");
75 if (left.length()
[all...]
H A DConcatenationRopeReverseIteratorImpl.java59 if (start < 0 || start > rope.length()) {
66 return (this.currentRopePos + amount <= this.currentRope.length());
93 this.currentRopePos = this.currentRope.length();
94 this.currentAbsolutePos = this.rope.length();
122 this.currentRopePos = this.currentRope.length();
H A DConcatenationRopeIteratorImpl.java57 if (start < 0 || start > rope.length()) {
73 return this.currentRopePos < this.currentRope.length() - 1 || !this.toTraverse.isEmpty();
106 final int available = this.currentRope.length() - this.currentRopePos - 1;
H A DRepeatedCharacterSequence.java49 public int length() { method in class:RepeatedCharacterSequence
/ropes-1.2.5/src/org/ahmadsoft/ropes/test/
H A DPerformanceTest.java68 if (args.length == 1) {
80 System.out.println("Read " + aChristmasCarol.length() + " bytes in " + PerformanceTest.time(x,y));
88 for (int j=0;j<deletePlan.length;++j) {
94 for (int k=20; k<=deletePlan.length; k+=20) {
95 System.out.println("Delete plan length: " + k);
114 for (int j=0;j<prependPlan.length;++j) {
119 for (int k=20; k<=prependPlan.length; k+=20) {
120 System.out.println("Prepend plan length: " + k);
141 for (int j=0;j<appendPlan.length;++j) {
147 for (int k=20; k<=appendPlan.length;
[all...]
H A DRopeTest.java89 assertEquals("round 0 1234567890", fromRope(r,0,r.length()));
101 assertEquals(1073741824, x1.length());
140 for (int j = 0; j < c2.length(); ++j) {
141 assertTrue("Has next (" + j + "/" + c2.length() + ")", i.hasNext());
159 for (int j=0; j<=z3.length(); ++j) {
166 assertTrue(4 == z4.length());
167 for (int j=0; j<=z4.length(); ++j) {
294 Assert.assertEquals("alphabeta", r1.insert(r1.length(), "beta").toString());
/ropes-1.2.5/
H A Dropes.jar ... y int j CharSequence sequence int fromIndex CharSequence me int length int[] bcs public org.ahmadsoft.ropes.Rope ...
/ropes-1.2.5/src/org/ahmadsoft/ropes/
H A DRope.java76 //@ ensures \result.length() == length() + 1;
86 //@ ensures \result.length() == length() + suffix.length();
97 //@ requires start <= end && start > -1 && end <= csq.length();
98 //@ ensures \result.length() == (length() + (end-start));
112 * is negative, greater than <code>length()</code>, or
115 //@ requires start <= end && start > -1 && end <= length();
326 write(Writer out, int offset, int length) argument
[all...]

Completed in 24 milliseconds