本文整理匯總了Java中java.util.concurrent.ConcurrentSkipListMap.clear方法的典型用法代碼示例。如果您正苦於以下問題:Java ConcurrentSkipListMap.clear方法的具體用法?Java ConcurrentSkipListMap.clear怎麽用?Java ConcurrentSkipListMap.clear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.concurrent.ConcurrentSkipListMap
的用法示例。
在下文中一共展示了ConcurrentSkipListMap.clear方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testEquals
import java.util.concurrent.ConcurrentSkipListMap; //導入方法依賴的package包/類
/**
* Maps with same contents are equal
*/
public void testEquals() {
ConcurrentSkipListMap map1 = map5();
ConcurrentSkipListMap map2 = map5();
assertEquals(map1, map2);
assertEquals(map2, map1);
map1.clear();
assertFalse(map1.equals(map2));
assertFalse(map2.equals(map1));
}
示例2: testClone
import java.util.concurrent.ConcurrentSkipListMap; //導入方法依賴的package包/類
/**
* A cloned map equals original
*/
public void testClone() {
ConcurrentSkipListMap x = map5();
ConcurrentSkipListMap y = x.clone();
assertNotSame(x, y);
assertEquals(x.size(), y.size());
assertEquals(x.toString(), y.toString());
assertEquals(x, y);
assertEquals(y, x);
y.clear();
assertTrue(y.isEmpty());
assertFalse(x.equals(y));
}
示例3: testClear
import java.util.concurrent.ConcurrentSkipListMap; //導入方法依賴的package包/類
/**
* clear removes all pairs
*/
public void testClear() {
ConcurrentSkipListMap map = map5();
map.clear();
assertEquals(0, map.size());
}