本文整理汇总了Java中org.pcollections.HashTreePMap.empty方法的典型用法代码示例。如果您正苦于以下问题:Java HashTreePMap.empty方法的具体用法?Java HashTreePMap.empty怎么用?Java HashTreePMap.empty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pcollections.HashTreePMap
的用法示例。
在下文中一共展示了HashTreePMap.empty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testEmpty
import org.pcollections.HashTreePMap; //导入方法依赖的package包/类
public void testEmpty() {
PMap<?,?> empty = HashTreePMap.empty();
UtilityTest.assertEqualsAndHash(new HashMap<Object,Object>(), empty);
assertEquals(0, empty.size());
assertTrue(empty.isEmpty());
for(@SuppressWarnings("unused") Object e : empty.entrySet())
fail();
}
示例2: hasCycle
import org.pcollections.HashTreePMap; //导入方法依赖的package包/类
public static <T, K> boolean hasCycle(Forest<T, K> forest) {
Checks.checkNotNull(forest, "forest must not be null");
PMap<K, Node<T, K>> seen = HashTreePMap.empty();
return forest
.getAllNodes()
.values()
.stream()
.anyMatch(node -> hasCycle(node, seen));
}
示例3: applyUnsafe
import org.pcollections.HashTreePMap; //导入方法依赖的package包/类
@Override
public PMap<String, V> applyUnsafe(JsonParser p) throws IOException {
Map<String, V> values = new HashMap<>();
if (p.nextToken() == JsonToken.END_OBJECT) {
return HashTreePMap.empty();
}
while (p.nextValue() != JsonToken.END_OBJECT) {
String fieldName = p.getCurrentName();
values.put(fieldName, valueDeserialiser.apply(p));
}
return HashTreePMap.from(values);
}
示例4: PcollectionsMapBuilder
import org.pcollections.HashTreePMap; //导入方法依赖的package包/类
PcollectionsMapBuilder() {
super(HashTreePMap.empty(), map -> map::plus, PcollectionsMap::new);
}
示例5: forTable
import org.pcollections.HashTreePMap; //导入方法依赖的package包/类
public static TableMapping forTable(String tableName) {
return new TableMapping(tableName, HashTreePMap.empty());
}