Lines Matching defs:depth
44 * Rebalance a rope if the depth has exceeded MAX_ROPE_DEPTH. If the
45 * rope depth is less than MAX_ROPE_DEPTH or if the rope is of unknown
51 if (r instanceof AbstractRope && ((AbstractRope) r).depth() > RopeUtilities.MAX_ROPE_DEPTH) {
97 * Returns the depth of the specified rope.
99 * @return the depth of the specified rope.
101 byte depth(final Rope r) {
103 return ((AbstractRope)r).depth();
111 final byte depth = this.depth(r);
112 if (depth >= RopeUtilities.FIBONACCI.length - 2)
114 return (RopeUtilities.FIBONACCI[depth + 2] <= r.length()); // TODO: not necessarily valid w/e.g. padding char sequences.
121 // begin a depth first loop.
158 public void visualize(final Rope r, final PrintStream out, final int depth) {
160 out.print(RopeUtilities.SPACES.substring(0,depth*2));
165 out.print(RopeUtilities.SPACES.substring(0,depth*2));
167 // this.visualize(((SubstringRope)r).getRope(), out, depth+1);
170 out.print(RopeUtilities.SPACES.substring(0,depth*2));
172 this.visualize(((ConcatenationRope)r).getLeft(), out, depth+1);
173 out.print(RopeUtilities.SPACES.substring(0,depth*2));
175 this.visualize(((ConcatenationRope)r).getRight(), out, depth+1);
183 // begin a depth first loop.
195 out.println("rope(length=" + r.length() + ", leaf nodes=" + leafNodes.size() + ", non-leaf nodes=" + nonLeaf + ", depth=" + RopeUtilities.INSTANCE.depth(r) + ")");