List of usage examples for org.apache.commons.collections4.multimap HashSetValuedHashMap HashSetValuedHashMap
public HashSetValuedHashMap()
From source file:com.github.alexfalappa.nbspringboot.navigator.MappedElement.java
private final String computeHandlerSignature(Element element) { StringBuilder sb = new StringBuilder(element.getSimpleName()); if (element instanceof ExecutableElement) { // store arguments with same unqualified type name ExecutableElement eel = (ExecutableElement) element; SetValuedMap<String, String> mm = new HashSetValuedHashMap<>(); for (VariableElement var : eel.getParameters()) { String fullType = var.asType().toString(); mm.put(Utils.shortenJavaType(fullType), fullType); }//from w w w .j av a2 s .c o m // build up argument list sb.append('('); for (int i = 0; i < eel.getParameters().size(); i++) { VariableElement var = eel.getParameters().get(i); String fullType = var.asType().toString(); final String shortType = Utils.shortenJavaType(fullType); if (mm.get(shortType).size() > 1) { sb.append(fullType); } else { sb.append(shortType); } if (i < eel.getParameters().size() - 1) { sb.append(", "); } } sb.append(") : "); sb.append(Utils.shortenJavaType(eel.getReturnType().toString())); } return sb.toString(); }
From source file:com.github.sevntu.checkstyle.ordering.MethodOrder.java
private static MultiValuedMap<MethodInvocation, MethodInvocation> getMethodInvocationsNesting( Map<ResolvedCall, MethodInvocation> callToInvocation) { final SetValuedMap<MethodInvocation, MethodInvocation> nestedInside = new HashSetValuedHashMap<>(); callToInvocation.entrySet().stream().forEach(entry -> { final ResolvedCall resolvedCall = entry.getKey(); final MethodInvocation methodInvocation = entry.getValue(); callToInvocation.keySet().stream().filter(rc -> !rc.equals(resolvedCall)) .filter(resolvedCall::isNestedInside) .forEach(rc -> nestedInside.put(methodInvocation, callToInvocation.get(rc))); });/*from ww w . j a v a 2s. c o m*/ return nestedInside; }
From source file:org.linqs.psl.application.groundrulestore.AtomRegisterGroundRuleStore.java
public AtomRegisterGroundRuleStore() { super(); atomMapping = new HashSetValuedHashMap<GroundAtom, GroundRule>(); }
From source file:org.linqs.psl.application.groundrulestore.MemoryGroundRuleStore.java
public MemoryGroundRuleStore() { groundRules = new HashSetValuedHashMap<Rule, GroundRule>(); }
From source file:org.phenotips.vocabulary.internal.hpoannotations.AbstractPhenotypeForDiseaseAnnotationsExtension.java
@Override protected void processCSVRecordRow(@Nonnull final CSVRecord row, @Nonnull final Vocabulary vocabulary) { // The annotation source file contains data for several disorder databases. Only want to look at data that is // relevant for the current vocabulary. final String dbName = getRowItem(row, VOCABULARY_ID_COLUMN); if (StringUtils.isNotBlank(dbName)) { String diseaseId = getRowItem(row, TERM_ID_COLUMN); final String symptomId = getRowItem(row, PHENOTYPE_COLUMN); if (StringUtils.isNotBlank(diseaseId) && StringUtils.isNotBlank(symptomId)) { diseaseId = vocabularyIdToTermPrefix(dbName) + diseaseId; MultiValuedMap<String, String> termData = this.data.get(diseaseId); if (termData == null) { termData = new HashSetValuedHashMap<>(); this.data.put(diseaseId, termData); }//from w w w . java 2 s . c o m termData.put(getDirectPhenotypesLabel(), symptomId); termData.putAll(getAllAncestorPhenotypesLabel(), getSelfAndAncestorTermIds(symptomId)); } } }