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


Java SetMultimap.get方法代码示例

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


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

示例1: toevoegenAttributenAanDienstbundelGroepen

import com.google.common.collect.SetMultimap; //导入方法依赖的package包/类
private void toevoegenAttributenAanDienstbundelGroepen(final List<DienstbundelGroep> alleDienstBundelgroepen,
                                                       final Map<Integer, Dienstbundel> dienstbundelIdMap,
                                                       final SetMultimap<Integer, DienstbundelGroepAttribuut> dbGrAttrBijDbGroep) {
    for (final DienstbundelGroep dienstbundelGroep : alleDienstBundelgroepen) {
        final Dienstbundel dienstbundel = dienstbundelIdMap.get(dienstbundelGroep.getDienstbundel().getId());
        if (dienstbundel != null) {
            dienstbundelGroep.setDienstbundel(dienstbundel);
        }
        final Set<DienstbundelGroepAttribuut> dienstbundelGroepAttribuutSet = dbGrAttrBijDbGroep.get(dienstbundelGroep.getId());
        if (dienstbundelGroepAttribuutSet != null) {
            dienstbundelGroep.setDienstbundelGroepAttribuutSet(dienstbundelGroepAttribuutSet);
        } else {
            dienstbundelGroep.setDienstbundelGroepAttribuutSet(Collections.emptySet());
        }
    }
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:17,代码来源:LeveringsAutorisatieCacheHelperImpl.java

示例2: toevoegenSetsAanDienstbundels

import com.google.common.collect.SetMultimap; //导入方法依赖的package包/类
private void toevoegenSetsAanDienstbundels(final List<Dienstbundel> alleDienstBundels,
                                           final SetMultimap<Integer, DienstbundelGroep> dienstbundelGroepenBijDienstbundelMap,
                                           final SetMultimap<Integer, DienstbundelLo3Rubriek> dienstbundelLo3RubriekenBijDienstbundelMap,
                                           final SetMultimap<Integer, Dienst> dienstenBijDienstbundelMap) {
    for (final Dienstbundel dienstbundel : alleDienstBundels) {
        final Set<DienstbundelGroep> dienstbundelGroepSet = dienstbundelGroepenBijDienstbundelMap.get(dienstbundel.getId());
        final Set<DienstbundelLo3Rubriek> dienstbundelLo3RubriekSet = dienstbundelLo3RubriekenBijDienstbundelMap.get(dienstbundel.getId());
        if (dienstbundelGroepSet != null) {
            dienstbundel.setDienstbundelGroepSet(dienstbundelGroepSet);
            dienstbundel.setDienstbundelLo3RubriekSet(dienstbundelLo3RubriekSet);
            dienstbundel.setDienstSet(dienstenBijDienstbundelMap.get(dienstbundel.getId()));
        } else {
            dienstbundel.setDienstbundelGroepSet(Collections.emptySet());
            dienstbundel.setDienstSet(Collections.emptySet());
        }
    }
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:18,代码来源:LeveringsAutorisatieCacheHelperImpl.java

示例3: filterHandelingen

import com.google.common.collect.SetMultimap; //导入方法依赖的package包/类
private Set<HandelingVoorPublicatie> filterHandelingen(final Set<Long> personenInLevering, final SetMultimap<Long, Long> admhndMap) {
    final Set<HandelingVoorPublicatie> teLeverenHandelingen = new HashSet<>();
    //loop over handelingen zonder status in levering en bepaal unieke bijgehouden persoon sets
    for (Long admhnId : admhndMap.keySet()) {
        final Set<Long> bijgehoudenPersonen = admhndMap.get(admhnId);
        if (Collections.disjoint(bijgehoudenPersonen, personenInLevering)) {
            final HandelingVoorPublicatie handelingVoorPublicatie = new HandelingVoorPublicatie();
            handelingVoorPublicatie.setAdmhndId(admhnId);
            handelingVoorPublicatie.setBijgehoudenPersonen(bijgehoudenPersonen);
            teLeverenHandelingen.add(handelingVoorPublicatie);
            personenInLevering.addAll(bijgehoudenPersonen);
        } else {
            LOGGER.debug(String.format("admhnd %s voor persoon al in levering, discard voor nu. Worden later opgepakt", admhnId));
        }
    }
    return teLeverenHandelingen;
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:18,代码来源:AdmhndProducerVoorLeveringServiceImpl.java

示例4: writeToFile

import com.google.common.collect.SetMultimap; //导入方法依赖的package包/类
private void writeToFile(InclusionDependency uind, SetMultimap<Integer, Integer> uindCoordinates, Path path)
        throws IOException {
    ImmutableList<Integer> lhsCoordinates = uindCoordinates.keySet().stream()
            .sorted().collect(toImmutableList());
    try (BufferedWriter writer = Files.newBufferedWriter(path, UTF_8)) {
        for (Integer index : lhsCoordinates) {
            UindCoordinates coordinates = new UindCoordinates(uind, index, uindCoordinates.get(index));
            writer.write(coordinates.toLine());
            writer.newLine();
        }
    }
}
 
开发者ID:HPI-Information-Systems,项目名称:AdvancedDataProfilingSeminar,代码行数:13,代码来源:CoordinatesRepository.java

示例5: toevoegenDienstbundelsAanLevAutorisaties

import com.google.common.collect.SetMultimap; //导入方法依赖的package包/类
private void toevoegenDienstbundelsAanLevAutorisaties(final Map<Integer, Leveringsautorisatie> leveringsAutorisatieMap,
                                                      final SetMultimap<Integer, Dienstbundel> dienstbundelMap) {
    for (Leveringsautorisatie leveringsautorisatie : leveringsAutorisatieMap.values()) {
        final Set<Dienstbundel> dienstbundelSet = dienstbundelMap.get(leveringsautorisatie.getId());
        if (dienstbundelSet != null) {
            leveringsautorisatie.setDienstbundelSet(dienstbundelSet);
        } else {
            leveringsautorisatie.setDienstbundelSet(Collections.emptySet());
        }
    }
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:12,代码来源:LeveringsAutorisatieCacheHelperImpl.java

示例6: checkFieldInitialization

import com.google.common.collect.SetMultimap; //导入方法依赖的package包/类
/**
 * check that all @NonNull fields of the class are properly initialized
 *
 * @param tree the class
 * @param state visitor state
 */
private void checkFieldInitialization(ClassTree tree, VisitorState state) {
  FieldInitEntities entities = collectEntities(tree, state);
  Symbol.ClassSymbol classSymbol = ASTHelpers.getSymbol(tree);
  class2Entities.put(classSymbol, entities);
  // set of all non-null instance fields f such that *some* constructor does not initialize f
  Set<Symbol> notInitializedInConstructors;
  SetMultimap<MethodTree, Symbol> constructorInitInfo;
  if (entities.constructors().isEmpty()) {
    constructorInitInfo = null;
    notInitializedInConstructors = entities.nonnullInstanceFields();
  } else {
    constructorInitInfo = checkConstructorInitialization(entities, state);
    notInitializedInConstructors = ImmutableSet.copyOf(constructorInitInfo.values());
  }
  class2ConstructorUninit.putAll(classSymbol, notInitializedInConstructors);
  Set<Symbol> notInitializedAtAll =
      notAssignedInAnyInitializer(entities, notInitializedInConstructors, state);
  SetMultimap<Element, Element> errorFieldsForInitializer = LinkedHashMultimap.create();
  // non-null if we have a single initializer method
  Symbol.MethodSymbol singleInitializerMethod = null;
  if (entities.instanceInitializerMethods().size() == 1) {
    singleInitializerMethod =
        ASTHelpers.getSymbol(entities.instanceInitializerMethods().iterator().next());
  }
  for (Symbol uninitField : notInitializedAtAll) {
    if (singleInitializerMethod != null) {
      // report it on the initializer
      errorFieldsForInitializer.put(singleInitializerMethod, uninitField);
    } else if (constructorInitInfo == null) {
      // report it on the field
      fieldsWithInitializationErrors.add(uninitField);
    } else {
      // report it on each constructor that does not initialize it
      for (MethodTree methodTree : constructorInitInfo.keySet()) {
        Set<Symbol> uninitFieldsForConstructor = constructorInitInfo.get(methodTree);
        if (uninitFieldsForConstructor.contains(uninitField)) {
          errorFieldsForInitializer.put(ASTHelpers.getSymbol(methodTree), uninitField);
        }
      }
    }
  }
  for (Element constructorElement : errorFieldsForInitializer.keySet()) {
    initializerErrors.put(
        constructorElement,
        errMsgForInitializer(errorFieldsForInitializer.get(constructorElement)));
  }
  // For static fields
  Set<Symbol> notInitializedStaticFields = notInitializedStatic(entities, state);
  for (Symbol uninitSField : notInitializedStaticFields) {
    // Always report it on the field for static fields (can't do @SuppressWarnings on a static
    // initialization block
    // anyways).
    fieldsWithInitializationErrors.add(uninitSField);
  }
}
 
开发者ID:uber,项目名称:NullAway,代码行数:62,代码来源:NullAway.java

示例7: parseSimpleFieldAnnotation

import com.google.common.collect.SetMultimap; //导入方法依赖的package包/类
private void parseSimpleFieldAnnotation(SetMultimap<String, ASMData> annotations, String annotationClassName, Function<ModContainer, Object> retriever) throws IllegalAccessException
{
    String[] annName = annotationClassName.split("\\.");
    String annotationName = annName[annName.length - 1];
    for (ASMData targets : annotations.get(annotationClassName))
    {
        String targetMod = (String)targets.getAnnotationInfo().get("value");
        Field f = null;
        Object injectedMod = null;
        ModContainer mc = this;
        boolean isStatic = false;
        Class<?> clz = modInstance.getClass();
        if (!Strings.isNullOrEmpty(targetMod))
        {
            if (Loader.isModLoaded(targetMod))
            {
                mc = Loader.instance().getIndexedModList().get(targetMod);
            }
            else
            {
                mc = null;
            }
        }
        if (mc != null)
        {
            try
            {
                clz = Class.forName(targets.getClassName(), true, Loader.instance().getModClassLoader());
                f = clz.getDeclaredField(targets.getObjectName());
                f.setAccessible(true);
                isStatic = Modifier.isStatic(f.getModifiers());
                injectedMod = retriever.apply(mc);
            }
            catch (Exception e)
            {
                Throwables.propagateIfPossible(e);
                FMLLog.log(getModId(), Level.WARN, e, "Attempting to load @%s in class %s for %s and failing", annotationName, targets.getClassName(), mc.getModId());
            }
        }
        if (f != null)
        {
            Object target = null;
            if (!isStatic)
            {
                target = modInstance;
                if (!modInstance.getClass().equals(clz))
                {
                    FMLLog.log(getModId(), Level.WARN, "Unable to inject @%s in non-static field %s.%s for %s as it is NOT the primary mod instance", annotationName, targets.getClassName(), targets.getObjectName(), mc.getModId());
                    continue;
                }
            }
            f.set(target, injectedMod);
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:56,代码来源:FMLModContainer.java


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