本文整理汇总了Java中it.unimi.dsi.lang.MutableString.delete方法的典型用法代码示例。如果您正苦于以下问题:Java MutableString.delete方法的具体用法?Java MutableString.delete怎么用?Java MutableString.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类it.unimi.dsi.lang.MutableString
的用法示例。
在下文中一共展示了MutableString.delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
示例3: binary
import it.unimi.dsi.lang.MutableString; //导入方法依赖的package包/类
public static String binary(long l, boolean reverse) {
if (reverse) l = Long.reverse(l);
final MutableString s = new MutableString().append("0000000000000000000000000000000000000000000000000000000000000000000000000").append(Long.toBinaryString(l));
s.delete(0, s.length() - 64);
s.insert(0, '\n');
s.append('\n');
for(int i = 0; i < 32; i++) s.append(" ").append(Long.toHexString((l >>> (31 - i) * 2) & 0x3));
s.append('\n');
for(int i = 0; i < 16; i++) s.append(" ").append(Long.toHexString((l >>> (15 - i) * 4) & 0xF));
s.append('\n');
return s.toString();
}
示例4: binary
import it.unimi.dsi.lang.MutableString; //导入方法依赖的package包/类
public static String binary(long l, boolean reverse) {
if (reverse) l = Long.reverse(l);
MutableString s = new MutableString().append("0000000000000000000000000000000000000000000000000000000000000000000000000").append(Long.toBinaryString(l));
s.delete(0, s.length() - 64);
s.insert(0, '\n');
s.append('\n');
for(int i = 0; i < 32; i++) s.append(" ").append(Long.toHexString((l >>> (31 - i) * 2) & 0x3));
s.append('\n');
for(int i = 0; i < 16; i++) s.append(" ").append(Long.toHexString((l >>> (15 - i) * 4) & 0xF));
s.append('\n');
return s.toString();
}
示例5: flags2String
import it.unimi.dsi.lang.MutableString; //导入方法依赖的package包/类
/** Produces a string representing the values coded in the given flag mask.
*
* @param flags a flag mask.
* @return a string representing the flag mask.
*/
private static MutableString flags2String( final int flags ) {
MutableString s = new MutableString();
if ( ( flags & 0xF ) != 0 ) s.append( " | " ).append( "OUTDEGREES_" ).append( CompressionFlags.CODING_NAME[ flags & 0xF ] );
if ( ( ( flags >>> 4 ) & 0xF ) != 0 ) s.append( " | " ).append( "BLOCKS_" ).append( CompressionFlags.CODING_NAME[ ( flags >>> 4 ) & 0xF ] );
if ( ( ( flags >>> 8 ) & 0xF ) != 0 ) s.append( " | " ).append( "RESIDUALS_" ).append( CompressionFlags.CODING_NAME[ ( flags >>> 8 ) & 0xF ] );
if ( ( ( flags >>> 12 ) & 0xF ) != 0 ) s.append( " | " ).append( "REFERENCES_" ).append( CompressionFlags.CODING_NAME[ ( flags >>> 12 ) & 0xF ] );
if ( ( ( flags >>> 16 ) & 0xF ) != 0 ) s.append( " | " ).append( "BLOCK_COUNT_" ).append( CompressionFlags.CODING_NAME[ ( flags >>> 16 ) & 0xF ] );
if ( ( ( flags >>> 20 ) & 0xF ) != 0 ) s.append( " | " ).append( "OFFSETS_" ).append( CompressionFlags.CODING_NAME[ ( flags >>> 20 ) & 0xF ] );
if ( s.length() != 0 ) s.delete( 0, 3 );
return s;
}