@Override public void visit(MutableRel node) { Spaces.append(buf, level * 2); if (node == null) { buf.append("null"); } else { node.digest(buf); buf.append("\n"); ++level; super.visit(node); --level; } }
/** Appends current number of spaces to a {@link StringBuilder}. */ public StringBuilder spaces(StringBuilder buf) { return Spaces.append(buf, n); }
/** Appends current number of spaces to a {@link StringBuilder}. */ public StringBuilder spaces(StringBuilder buf) { return Spaces.append(buf, n); }
/** Appends current number of spaces to a {@link StringBuilder}. */ public StringBuilder spaces(StringBuilder buf) { return Spaces.append(buf, n); }
void indent(int indent) { if (indent < 0) { throw new IllegalArgumentException("negative indent " + indent); } Spaces.append(pw, indent); charCount += indent; }
void indent(int indent) { if (indent < 0) { throw new IllegalArgumentException("negative indent " + indent); } Spaces.append(pw, indent); charCount += indent; }
private void newline(StringBuilder buf, int indent) { Spaces.append(buf.append('\n'), indent * 2); }
private void newline(StringBuilder buf, int indent) { Spaces.append(buf.append('\n'), indent * 2); }
/** Returns a string that is padded on the right with spaces to the given * length. */ public static String padRight(String string, int n) { final int x = n - string.length(); if (x <= 0) { return string; } // Replacing StringBuffer with String would hurt performance. //noinspection StringBufferReplaceableByString return append(new StringBuilder(string), x).toString(); }
/** Returns a string that is padded on the right with spaces to the given * length. */ public static String padRight(String string, int n) { final int x = n - string.length(); if (x <= 0) { return string; } // Replacing StringBuffer with String would hurt performance. //noinspection StringBufferReplaceableByString return append(new StringBuilder(string), x).toString(); }
/** Returns a string that is padded on the right with spaces to the given * length. */ public static String padRight(String string, int n) { final int x = n - string.length(); if (x <= 0) { return string; } // Replacing StringBuffer with String would hurt performance. //noinspection StringBufferReplaceableByString return append(new StringBuilder(string), x).toString(); }
/** Returns a string that is padded on the left with spaces to the given * length. */ public static String padLeft(String string, int n) { final int x = n - string.length(); if (x <= 0) { return string; } // Replacing StringBuffer with String would hurt performance. //noinspection StringBufferReplaceableByString return append(new StringBuilder(), x).append(string).toString(); }
/** Returns a string that is padded on the left with spaces to the given * length. */ public static String padLeft(String string, int n) { final int x = n - string.length(); if (x <= 0) { return string; } // Replacing StringBuffer with String would hurt performance. //noinspection StringBufferReplaceableByString return append(new StringBuilder(), x).append(string).toString(); }
/** Returns a string that is padded on the left with spaces to the given * length. */ public static String padLeft(String string, int n) { final int x = n - string.length(); if (x <= 0) { return string; } // Replacing StringBuffer with String would hurt performance. //noinspection StringBufferReplaceableByString return append(new StringBuilder(), x).append(string).toString(); }
/** Returns a string that is padded on the right with spaces to the current * length. */ public String padRight(String string) { Spaces.padRight(string, n); final int x = n - string.length(); if (x <= 0) { return string; } // Replacing StringBuffer with String would hurt performance. //noinspection StringBufferReplaceableByString return Spaces.append(new StringBuilder(string), x).toString(); } }
/** Returns a string that is padded on the right with spaces to the current * length. */ public String padRight(String string) { Spaces.padRight(string, n); final int x = n - string.length(); if (x <= 0) { return string; } // Replacing StringBuffer with String would hurt performance. //noinspection StringBufferReplaceableByString return Spaces.append(new StringBuilder(string), x).toString(); } }
/** Returns a string that is padded on the right with spaces to the current * length. */ public String padRight(String string) { Spaces.padRight(string, n); final int x = n - string.length(); if (x <= 0) { return string; } // Replacing StringBuffer with String would hurt performance. //noinspection StringBufferReplaceableByString return Spaces.append(new StringBuilder(string), x).toString(); } }
/** * Prints the given code with line numbering. */ public static void debugCode(PrintStream out, String code) { out.println(); StringReader sr = new StringReader(code); BufferedReader br = new BufferedReader(sr); try { String line; for (int i = 1; (line = br.readLine()) != null; i++) { out.print("/*"); String number = Integer.toString(i); if (number.length() < 4) { Spaces.append(out, 4 - number.length()); } out.print(number); out.print(" */ "); out.println(line); } } catch (IOException e) { // not possible } }
@Override public void visit(MutableRel node) { Spaces.append(buf, level * 2); if (node == null) { buf.append("null"); } else { node.digest(buf); buf.append("\n"); ++level; super.visit(node); --level; } }
@Override public void visit(MutableRel node) { Spaces.append(buf, level * 2); if (node == null) { buf.append("null"); } else { node.digest(buf); buf.append("\n"); ++level; super.visit(node); --level; } }