當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。