本文整理汇总了Java中java.util.concurrent.ConcurrentSkipListMap.get方法的典型用法代码示例。如果您正苦于以下问题:Java ConcurrentSkipListMap.get方法的具体用法?Java ConcurrentSkipListMap.get怎么用?Java ConcurrentSkipListMap.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.concurrent.ConcurrentSkipListMap
的用法示例。
在下文中一共展示了ConcurrentSkipListMap.get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addProperty
import java.util.concurrent.ConcurrentSkipListMap; //导入方法依赖的package包/类
public synchronized void addProperty(Property property) {
ConcurrentSkipListMap<String, ConcurrentSkipListSet<Property>> propertiesByKey = propertiesByNameAndKey.get(property.getName());
if (propertiesByKey == null) {
propertiesByKey = new ConcurrentSkipListMap<>();
this.propertiesByNameAndKey.put(property.getName(), propertiesByKey);
}
ConcurrentSkipListSet<Property> properties = propertiesByKey.get(property.getKey());
if (properties == null) {
properties = new ConcurrentSkipListSet<>();
propertiesByKey.put(property.getKey(), properties);
}
properties.add(property);
this.propertiesList.add(property);
}
示例2: testGet_NullPointerException
import java.util.concurrent.ConcurrentSkipListMap; //导入方法依赖的package包/类
/**
* get(null) of nonempty map throws NPE
*/
public void testGet_NullPointerException() {
ConcurrentSkipListMap c = map5();
try {
c.get(null);
shouldThrow();
} catch (NullPointerException success) {}
}