本文整理汇总了Java中gnu.trove.map.TIntObjectMap.putAll方法的典型用法代码示例。如果您正苦于以下问题:Java TIntObjectMap.putAll方法的具体用法?Java TIntObjectMap.putAll怎么用?Java TIntObjectMap.putAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gnu.trove.map.TIntObjectMap
的用法示例。
在下文中一共展示了TIntObjectMap.putAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMesh
import gnu.trove.map.TIntObjectMap; //导入方法依赖的package包/类
public void createMesh(List<Mesher> meshers, JmeResourceManager resourceManager) {
Realm realm = chunk.getRealm();
TIntObjectMap<Mesh> meshes = new TIntObjectHashMap<>();
for (Mesher mesher : meshers) {
meshes.putAll(mesher.buildMeshes(chunk));
}
geometries.clear();
for (int key : meshes.keys()) {
Block block = realm.getCosmos().getBlocks().get(key);
Geometry geometry = new Geometry(chunk.toString() + ":" + block.getName(), meshes.get(key));
geometry.setMaterial(resourceManager.getMaterial(block));
geometry.setQueueBucket(Bucket.Transparent);
geometries.add(geometry);
}
}
示例2: testPutAllMap
import gnu.trove.map.TIntObjectMap; //导入方法依赖的package包/类
public void testPutAllMap() {
int element_count = 20;
int[] keys = new int[element_count];
String[] vals = new String[element_count];
TIntObjectMap<String> control = new TIntObjectHashMap<String>();
for ( int i = 0; i < element_count; i++ ) {
keys[i] = i + 1;
vals[i] = Integer.toString( i + 1 );
control.put( keys[i], vals[i] );
}
TIntObjectMap<String> map = new TIntObjectHashMap<String>();
Map<Integer, String> source = new HashMap<Integer, String>();
for ( int i = 0; i < element_count; i++ ) {
source.put( keys[i], vals[i] );
}
map.putAll( source );
assertEquals( control, map );
}
示例3: testPutAll
import gnu.trove.map.TIntObjectMap; //导入方法依赖的package包/类
public void testPutAll() throws Exception {
TIntObjectMap<String> t = new TIntObjectHashMap<String>();
TIntObjectMap<String> m = new TIntObjectHashMap<String>();
m.put( 2, "one" );
m.put( 4, "two" );
m.put( 6, "three" );
t.put( 5, "four" );
assertEquals( 1, t.size() );
t.putAll( m );
assertEquals( 4, t.size() );
assertEquals( "two", t.get( 4 ) );
}