本文整理匯總了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 ) );
}