public void add(final Long projectId, final Long projectRoleId) { if ((projectId != null) && (projectRoleId != null)) { map.putSingle(projectId, projectRoleId); } }
public boolean contains(final Object value) { return delegate.contains(value); }
public boolean containsValue(final Collection<?> value) { return delegate.containsValue(value); }
private static List<ProjectIssueTypeContexts> init(final ClauseContext clauseContext) { final MultiMap<ProjectContext, IssueTypeContext, Set<IssueTypeContext>> contextSetMap = MultiMaps.create(new Supplier<Set<IssueTypeContext>>() { public Set<IssueTypeContext> get() { return new HashSet<IssueTypeContext>(); } }); final Set<ProjectIssueTypeContext> contexts = clauseContext.getContexts(); for (ProjectIssueTypeContext context : contexts) { contextSetMap.putSingle(context.getProjectContext(), context.getIssueTypeContext()); } final List<ProjectIssueTypeContexts> ctxs = new ArrayList<ProjectIssueTypeContexts>(contextSetMap.size()); for (Map.Entry<ProjectContext, Set<IssueTypeContext>> entry : contextSetMap.entrySet()) { ctxs.add(new ProjectIssueTypeContexts(entry.getKey(), entry.getValue())); } return ctxs; } }
Set<Component> getComponents() { final MultiMap<Object, Class<?>, Set<Class<?>>> instances = MultiMaps.create(new Supplier<Set<Class<?>>>() { public Set<Class<?>> get() { return new HashSet<>(); } }); for (final Class<?> exposedInterface : availableComponents) { final Object instance = getComponentInstance(exposedInterface); if (instance != null) { instances.putSingle(instance, exposedInterface); } } final Set<Component> result = new HashSet<>(); for (final Map.Entry<Object, Set<Class<?>>> entry : instances.entrySet()) { result.add(new Component(entry.getKey(), entry.getValue())); } return Collections.unmodifiableSet(result); } }
private void mergeBuckets() { int minGroupSize = alphabetBuckets.size() / KEYS.length + MIN_GROUP_SIZE; String lastBucketKey = KEYS[0]; boolean flipLastBucketKey = true; Set<String> currentBucket = new TreeSet<String>(); for (String currentKey : KEYS) { if (flipLastBucketKey) { lastBucketKey = currentKey; flipLastBucketKey = false; } final Set<String> currentLabels = alphabetBuckets.remove(currentKey + ""); if (currentLabels != null) { currentBucket.addAll(currentLabels); if (currentBucket.size() >= minGroupSize) { alphabetBuckets.put(getBucketKey(lastBucketKey, currentKey), currentBucket); currentBucket = new TreeSet<String>(); flipLastBucketKey = true; } } } if (!currentBucket.isEmpty()) { alphabetBuckets.put(getBucketKey(lastBucketKey, LAST_KEY), currentBucket); } }
/** * Returns an iterator for this map * @return an iterator */ public Iterator<Entry> iterator() { return CollectionUtil.transformIterator(map.entrySet().iterator(), new Function<Map.Entry<Long, List<Long>>, Entry>() { public Entry get(final java.util.Map.Entry<Long, List<Long>> entry) { return new Entry(entry.getKey(), entry.getValue()); } }); }
/** * Returns true if the map is empty, false otherwise * @return true if the map is empty, false otherwise */ public boolean isEmpty() { return map.isEmpty(); }
public Set<String> getContents(String key) { return alphabetBuckets.get(key); }
public void copyTo(final Collection<V> copyTo) { delegate.copyTo(copyTo); }
public C allValues() { return unmodifiableTransformer.get(delegate.allValues()); }
public Collection<String> getKeys() { TreeSet<String> keys = new TreeSet<String>(new Comparator<String>() { public int compare(String o1, String o2) { if (o1.equals(o2)) { return 0; } if (NUMERIC.equals(o1)) { return 1; } else if (NUMERIC.equals(o2)) { return -1; } else { return collator.compare(o1, o2); } } }); keys.addAll(alphabetBuckets.keySet()); return keys; }
@Override public Set<Entry<K, C>> entrySet() final Set<Entry<K, C>> delegateSet = delegate.entrySet(); return new DecoratingSet<Entry<K, C>>(delegateSet, new Function<Entry<K, C>, Entry<K, C>>()
private void fillBuckets() { for (String label : data) { char firstCharacter = extractFirstCharacter(label); if (Character.isLetter(firstCharacter)) { alphabetBuckets.putSingle(Character.toUpperCase(firstCharacter) + "", label); } else if (Character.isDigit(firstCharacter)) { alphabetBuckets.putSingle(NUMERIC, label); } } }
while (projectIdGV != null) groupNamesUserInForProjects.putSingle(projectIdGV.getLong(ROLE_ACTOR_PID), projectIdGV.getString(ROLE_ACTOR_PARAMETER));