本文整理汇总了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());
}