本文整理匯總了Java中gnu.trove.THashMap.keySet方法的典型用法代碼示例。如果您正苦於以下問題:Java THashMap.keySet方法的具體用法?Java THashMap.keySet怎麽用?Java THashMap.keySet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gnu.trove.THashMap
的用法示例。
在下文中一共展示了THashMap.keySet方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testHashMapCloneDoesNotDependOnTheSource
import gnu.trove.THashMap; //導入方法依賴的package包/類
public void testHashMapCloneDoesNotDependOnTheSource() {
THashMap<Integer, int[]> map = new THashMap<Integer, int[]>();
map.put(0, new int[2]);
map.put(1, new int[2]);
THashMap<Integer, int[]> clone = map.clone();
assertEquals(clone.size(), 2);
Set<Integer> keys = clone.keySet();
assertEquals(keys.size(), 2);
assertEquals(ContainerUtil.newHashSet(0,1), keys);
map.clear();
assertEquals(clone.size(), 2);
keys = clone.keySet();
assertEquals(keys.size(), 2);
assertEquals(ContainerUtil.newHashSet(0,1), keys);
}
示例2: readExternalImpl
import gnu.trove.THashMap; //導入方法依賴的package包/類
protected void readExternalImpl(Element e) {
if (e.getAttribute("injector-id") == null) {
setClassName(JDOMExternalizer.readString(e, "CLASS"));
//setApplyInHierarchy(JDOMExternalizer.readBoolean(e, "APPLY_IN_HIERARCHY"));
readOldFormat(e);
final THashMap<String, String> map = new THashMap<String, String>();
JDOMExternalizer.readMap(e, map, null, "SIGNATURES");
for (String s : map.keySet()) {
final String fixedSignature = fixSignature(s, false);
myParameterMap.put(fixedSignature, new MethodInfo(fixedSignature, map.get(s)));
}
}
}