当前位置: 首页>>代码示例>>Java>>正文


Java MutableString.delete方法代码示例

本文整理汇总了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());
}
 
开发者ID:vigna,项目名称:Sux4J,代码行数:22,代码来源:ZFastTrieDistributor.java

示例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());
}
 
开发者ID:vigna,项目名称:Sux4J,代码行数:24,代码来源:PaCoTrieDistributor.java

示例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();
}
 
开发者ID:vigna,项目名称:Sux4J,代码行数:13,代码来源:JacobsonBalancedParentheses.java

示例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();
}
 
开发者ID:vigna,项目名称:Sux4J,代码行数:13,代码来源:BalancedParenthesesTestCase.java

示例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;
}
 
开发者ID:lhelwerd,项目名称:WebGraph,代码行数:19,代码来源:BVGraph.java


注:本文中的it.unimi.dsi.lang.MutableString.delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。