本文整理汇总了Java中it.unimi.dsi.lang.MutableString.charAt方法的典型用法代码示例。如果您正苦于以下问题:Java MutableString.charAt方法的具体用法?Java MutableString.charAt怎么用?Java MutableString.charAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类it.unimi.dsi.lang.MutableString
的用法示例。
在下文中一共展示了MutableString.charAt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: recToString
import it.unimi.dsi.lang.MutableString; //导入方法依赖的package包/类
private void recToString(final Node n, final MutableString printPrefix, final MutableString result, final MutableString path, final int level) {
if (n == null) return;
result.append(printPrefix).append('(').append(level).append(')');
if (n.path != null) {
path.append(n.path);
result.append(" path: (").append(n.path.length()).append(") :").append(n.path);
}
result.append('\n');
path.append('0');
recToString(n.left, printPrefix.append('\t').append("0 => "), result, path, level + 1);
path.charAt(path.length() - 1, '1');
recToString(n.right, printPrefix.replace(printPrefix.length() - 5, printPrefix.length(), "1 => "), result, path, level + 1);
path.delete(path.length() - 1, path.length());
printPrefix.delete(printPrefix.length() - 6, printPrefix.length());
path.delete((int)(path.length() - n.path.length()), path.length());
}
示例2: recToString
import it.unimi.dsi.lang.MutableString; //导入方法依赖的package包/类
private void recToString(final Node n, final MutableString printPrefix, final MutableString result, final MutableString path, final int level) {
if (n == null) return;
result.append(printPrefix).append('(').append(level).append(')');
if (n.path != null) {
path.append(n.path);
result.append(" path:").append(n.path);
}
result.append('\n');
path.append('0');
recToString(n.left, printPrefix.append('\t').append("0 => "), result, path, level + 1);
path.charAt(path.length() - 1, '1');
recToString(n.right, printPrefix.replace(printPrefix.length() - 5, printPrefix.length(), "1 => "), result, path, level + 1);
path.delete(path.length() - 1, path.length());
printPrefix.delete(printPrefix.length() - 6, printPrefix.length());
//System.err.println("Path now: " + path + " Going to delete from " + (path.length() - n.pathLength));
path.delete((int)(path.length() - n.path.length()), path.length());
}