当前位置: 首页>>代码示例>>Java>>正文


Java HashMap.empty方法代码示例

本文整理汇总了Java中io.vavr.collection.HashMap.empty方法的典型用法代码示例。如果您正苦于以下问题:Java HashMap.empty方法的具体用法?Java HashMap.empty怎么用?Java HashMap.empty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.vavr.collection.HashMap的用法示例。


在下文中一共展示了HashMap.empty方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: diff

import io.vavr.collection.HashMap; //导入方法依赖的package包/类
public static Map<Phase, Vector<Patch>> diff(Option<VNode> a, Option<VNode> b) {
    if (!a.isEmpty() && b.isEmpty()) {
        LOG.error("Tried to remove root node");
        return HashMap.empty();
    }

    final Map<Phase, Vector<Patch>> patches;
    if (a.isEmpty()) {
        patches = b.isEmpty() ? HashMap.empty() : HashMap.of(Phase.STRUCTURE, Vector.of(new UpdateRootPatch(b.get())));
    } else {
        patches = doDiff(Vector.empty(), a.get(), b.get());
    }

    LOG.trace("Diff:\na:\n{}\nb:\n{}\nresult:\n{}", a, b, patches);
    return patches;
}
 
开发者ID:netopyr,项目名称:reduxfx,代码行数:17,代码来源:Differ.java

示例2: getValidSubTags

import io.vavr.collection.HashMap; //导入方法依赖的package包/类
private Map<QName,XSParticle> getValidSubTags(XSElementDeclaration elmt) {
    if (!(elmt.getTypeDefinition() instanceof XSComplexTypeDefinition)) {
        return HashMap.empty();
    }
    
    XSComplexTypeDefinition type = (XSComplexTypeDefinition) elmt.getTypeDefinition();
    if (type.getParticle() == null || !(type.getParticle().getTerm() instanceof XSModelGroup)) {
        return HashMap.empty();
    }
    
    XSModelGroup group = (XSModelGroup) type.getParticle().getTerm();
    if (group.getCompositor() != XSModelGroup.COMPOSITOR_SEQUENCE && group.getCompositor() != XSModelGroup.COMPOSITOR_CHOICE) {
        return HashMap.empty();
    }
    
    // We don't care whether it's SEQUENCE or CHOICE, we only want to know what are the valid sub-elements at this level.
    XSObjectList particles = group.getParticles();
    Map<QName,XSParticle> content = HashMap.empty();
    for (int j = 0; j < particles.getLength(); j++) {
        XSParticle sub = (XSParticle) particles.get(j);
        if (sub.getTerm() instanceof XSElementDeclaration) {
            XSElementDeclaration term = (XSElementDeclaration) sub.getTerm();
            content = content.put(new QName(term.getNamespace(), term.getName()), sub);
        }
    }
    return content;
}
 
开发者ID:Tradeshift,项目名称:ts-reaktive,代码行数:28,代码来源:XMLToJSON.java

示例3: empty

import io.vavr.collection.HashMap; //导入方法依赖的package包/类
/**
 * Returns a new, empty, {@link ACL} which will use this ACLBuilder to resolve changes.
 */
public ACL<R,C> empty() {
    return new ACL<>(this, HashMap.empty());
}
 
开发者ID:Tradeshift,项目名称:ts-reaktive,代码行数:7,代码来源:ACLBuilder.java

示例4: AttributesPatch

import io.vavr.collection.HashMap; //导入方法依赖的package包/类
public AttributesPatch(Vector<Object> path, String name, VProperty property) {
    this(path, HashMap.of(name, property), HashMap.empty());
}
 
开发者ID:netopyr,项目名称:reduxfx,代码行数:4,代码来源:AttributesPatch.java

示例5: StagesBuilder

import io.vavr.collection.HashMap; //导入方法依赖的package包/类
public StagesBuilder(Array<VNode> children) {
    super(Stages.class, HashMap.of(CHILDREN, children), HashMap.empty(), HashMap.empty(), HashMap.empty());
}
 
开发者ID:netopyr,项目名称:reduxfx,代码行数:4,代码来源:StagesBuilder.java

示例6: emptyMap

import io.vavr.collection.HashMap; //导入方法依赖的package包/类
@Override
<K, V> Map<K, V> emptyMap() {
    return HashMap.empty();
}
 
开发者ID:vavr-io,项目名称:vavr-jackson,代码行数:5,代码来源:HashMapTest.java

示例7: VavrMapBuilder

import io.vavr.collection.HashMap; //导入方法依赖的package包/类
VavrMapBuilder() {
  super(HashMap.empty(), map -> map::put, VavrMap::new);
}
 
开发者ID:msteindorfer,项目名称:criterion,代码行数:4,代码来源:VavrMapBuilder.java

示例8: SocketIOSessions

import io.vavr.collection.HashMap; //导入方法依赖的package包/类
public SocketIOSessions() {
    sessions = HashMap.empty();
}
 
开发者ID:javaBin,项目名称:Switcharoo,代码行数:4,代码来源:SocketIOSessions.java


注:本文中的io.vavr.collection.HashMap.empty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。