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


Java TIntObjectIterator.remove方法代码示例

本文整理汇总了Java中gnu.trove.iterator.TIntObjectIterator.remove方法的典型用法代码示例。如果您正苦于以下问题:Java TIntObjectIterator.remove方法的具体用法?Java TIntObjectIterator.remove怎么用?Java TIntObjectIterator.remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gnu.trove.iterator.TIntObjectIterator的用法示例。


在下文中一共展示了TIntObjectIterator.remove方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testIteratorRemoval2

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
public void testIteratorRemoval2() {
    int element_count = 10000;
    int remaining = element_count / 2;

    TIntObjectHashMap<String> map =
            new TIntObjectHashMap<String>( element_count, 0.5f, Integer.MIN_VALUE );

    for ( int pass = 0; pass < 10; pass++ ) {
        Random r = new Random();
        for ( int i = 0; i <= element_count; i++ ) {
            map.put( Integer.valueOf( r.nextInt() ), String.valueOf( i ) );
        }

        TIntObjectIterator iterator = map.iterator();
        while ( map.size() > remaining && iterator.hasNext() ) {
            iterator.advance();
            iterator.remove();
        }
    }
}
 
开发者ID:palantir,项目名称:trove-3.0.3,代码行数:21,代码来源:TPrimitiveObjectHashMapTest.java

示例2: process

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
@Override
public void process(@Nonnull final EntityPlayer player) {

	if (this.messages.size() == 0)
		return;

	// Go through the cached messages and get rid of those
	// that expire.
	final int currentTick = EnvironState.getTickCounter();
	final TIntObjectIterator<EntityBubbleContext> entityData = this.messages.iterator();
	while (entityData.hasNext()) {
		entityData.advance();
		final EntityBubbleContext ctx = entityData.value();
		if (ctx.clean(currentTick))
			entityData.remove();
	}
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:18,代码来源:SpeechBubbleHandler.java

示例3: dumpMap

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
protected void dumpMap() {
	try {
		tmpFileIndex++;
		String outfile = tmpDIR + "/" + tmpFileIndex + ".tmp";
		logger.info("dumping memory to file: " + outfile);
		PrintStream tmpContentFile = new PrintStream(outfile);
		TIntObjectIterator<T> it = id2item.iterator();
		while (it.hasNext()) {
			it.advance();
			T item = it.value();
			tmpContentFile.print(item.getID());
			tmpContentFile.print("\t");
			tmpContentFile.print(Serialization.serialize(item));
			tmpContentFile.print("\n");
			it.remove();
		}
		tmpContentFile.close();
	} catch (Exception e) {
		logger.error(e.toString());
	}		
}
 
开发者ID:hltfbk,项目名称:Excitement-TDMLEDA,代码行数:22,代码来源:UnlimitedMemoryBasedCountableIdentifiableStorage.java

示例4: process

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
@Override
public void process(@Nonnull final EntityPlayer player) {

	if (this.emojiParticles.size() > 0) {
		// Get rid of dead particles
		final TIntObjectIterator<IParticleMote> data = this.emojiParticles.iterator();
		while (data.hasNext()) {
			data.advance();
			if (!data.value().isAlive())
				data.remove();
		}
	}

}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:15,代码来源:EntityEmojiHandler.java

示例5: writeToRedis

import gnu.trove.iterator.TIntObjectIterator; //导入方法依赖的package包/类
static void writeToRedis(TIntObjectMap<HashMap<Integer,Double>> tmpLeftSimilarities,RedisBasedIDKeyPersistentBasicMap<HashMap<Integer,Double>> leftSimilarities) throws BasicMapException {		
	TIntObjectIterator<HashMap<Integer, Double>> it = tmpLeftSimilarities.iterator();
	while (it.hasNext()) {
		it.advance();
		leftSimilarities.put(it.key(), it.value());
		it.remove();
	}
}
 
开发者ID:hltfbk,项目名称:Excitement-TDMLEDA,代码行数:9,代码来源:RedisBasedRight2LeftSimilarities.java


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