Guava SetMultimap - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Guava SetMultimap class.

This code example shows how to use the following methods:put, putAll
                "setInt", 
                "setLong", 
                "setShort" 
        ); 
        interceptedMethods = HashMultimap.create();
        interceptedMethods.put("java.lang.reflect.Method", "invoke");
        interceptedMethods.putAll("java.lang.reflect.Field", fieldMethods);
        interceptedMethods.put("java.lang.reflect.Constructor", "newInstance");
        interceptedMethods.put("java.lang.Class", "newInstance");
    } 
 
    public int visit(LineContext context) throws Exception {
        String className = context.getClassName();
        Set<String> methods = interceptedMethods.get(className);
        if (methods != null && methods.isEmpty() == false) {
            String name = getName(context.getConstPool(), context.getVal());
            if (name != null && methods.contains(name)) {
                Bytecode bytecode = new Bytecode(context.getConstPool());
                String desc = getDesc(context.getConstPool(), context.getVal());
                if (context.getOp() == CodeIterator.INVOKEVIRTUAL) {
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:containsKey, get
    public String getFirst(String id) {
        String key = key(id);
        if (singleProperties.containsKey(key)) {
            return singleProperties.get(key);
        } else { 
            if (multiProperties.containsKey(key)) {
                return multiProperties.get(key).iterator().next();
            } 
        } 
        return null; 
    } 
 
    public Set<String> getAll(String id) {
        String key = key(id);
        Set<String> rv = new HashSet<String>();
        if (singleProperties.containsKey(key)) {
            rv.add(singleProperties.get(key));
        } else { 
            if (multiProperties.containsKey(key)) {
                rv.addAll(multiProperties.get(key));
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:entries
    public <U extends T> Set<U> replaceValues(Class<U> key, Iterable<? extends U> values) {
        return convertSet(key, inner.replaceValues(key, values));
    } 
 
    public Set<Map.Entry<Class<? extends T>, T>> entries() {
        return inner.entries();
    } 
 
    private <U extends T> Set<U> convertSet(Class<U> type, Set<T> values) {
        Set<U> results = Sets.newLinkedHashSetWithExpectedSize(values.size());
        for (T value : values) {
            results.add(type.cast(value));
        } 
        return results;
    } 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:put
	public static void banConnection(Class<? extends Pipe>... types) {
		if (types.length == 0) {
			return; 
		} 
		if (types.length == 1) {
			connectionBans.put(types[0], types[0]);
			return; 
		} 
		for (int i = 0; i < types.length; i++) {
			for (int j = 0; j < types.length; j++) {
				if (i == j) {
					continue; 
				} 
				connectionBans.put(types[i], types[j]);
			} 
		} 
	} 
 
	public static boolean canPipesConnect(Class<? extends Pipe> type1, Class<? extends Pipe> type2) {
		return !connectionBans.containsEntry(type1, type2);
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:get
        return assets.keySet();
    } 
 
    @Override 
    public Iterable<AssetUri> list(AssetType type) {
        return assetsByType.get(type);
    } 
 
    @Override 
    public List<URL> getOverride(AssetUri uri) {
        return Lists.newArrayList(overrides.get(uri));
    } 
 
    @Override 
    public List<URL> getDelta(AssetUri uri) {
        return Lists.newArrayList(deltas.get(uri));
    } 
 
    @Override 
    public Iterable<AssetUri> listOverrides() {
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:get
        return getCallbacks(dataId, null);
    } 
 
    protected Set<SubscribeCallback> getCallbacks(String dataId, String groupId) {
        String key = generateKey(dataId, groupId);
        return callBackMap.get(key);
    } 
 
    protected static String generateKey(String dataId, String groupId) {
        return StringUtils.trimToEmpty(dataId) + "_" + StringUtils.trimToEmpty(groupId);
    } 
 
    protected Object getLock(String dataId, String groupId) {
        String key = generateKey(dataId, groupId);
        return getLock(key);
    } 
 
    protected Object getLock(String key) {
        Object lock = new Object(); 
        Object expectLock = mutexes.putIfAbsent(key, lock);
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:get
	public boolean isEmpty(String containerHandle) {
		return getContainedURIs(containerHandle).isEmpty();
	} 
 
	public String getContainerHandle(URI uri) {
		Set<String> set = uri2container.get(uri);
		if (set!=null && !set.isEmpty())
			return set.iterator().next();
		return null; 
	} 
	 
	@Override 
	public String toString() {
		StringBuilder result = new StringBuilder();
		result.append("[");
		result.append(getClass().getSimpleName());
		Set<String> invisibleContainers = Sets.newHashSet(container2URIs.keySet());
		invisibleContainers.removeAll(containers);
		if (!invisibleContainers.isEmpty()) {
			result.append("\n  WARNING: invisible containers: ");
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:values
    } 
 
    @Override 
    public AllNodes getAllNodes()
    { 
        return new AllNodes(ImmutableSet.<Node>builder().add(localNode).addAll(remoteNodes.values()).build(), ImmutableSet.<Node>of(), ImmutableSet.<Node>of());
    } 
 
    @Override 
    public Node getCurrentNode()
    { 
        return localNode;
    } 
 
    @Override 
    public Set<Node> getCoordinators()
    { 
        // always use localNode as coordinator 
        return ImmutableSet.of(localNode);
    } 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:keySet
        this.spec = ImmutableSetMultimap.copyOf(requireNonNull(spec, "spec is null"));
    } 
 
    public Set<TpchScaledTable> listIndexedTables()
    { 
        return spec.keySet();
    } 
 
    public Iterable<Set<String>> getColumnIndexes(TpchScaledTable table)
    { 
        return spec.get(table);
    } 
 
    public static class Builder
    { 
        private final ImmutableSetMultimap.Builder<TpchScaledTable, Set<String>> builder = ImmutableSetMultimap.builder();
 
        public Builder addIndex(String tableName, double scaleFactor, Set<String> columnNames)
        { 
            builder.put(new TpchScaledTable(tableName, scaleFactor), columnNames);
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:asMap
			indexes.put(path, object); 
	} 
	 
	/** */ 
	public Map<Path, Collection<Object>> getIndexes() {
		return indexes.asMap(); 
	} 
 
	/** 
	 * Subclass can ignore lifecycle methods. 
	 */ 
	public boolean skipLifecycle() { 
		return false; 
	} 
 
	/** 
	 * Callback that we found a Ref in the object graph. Subclasses of this context may want to do something 
	 * special with this. 
	 */ 
	public Key saveRef(Ref<?> value, LoadConditions loadConditions) {
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Guava SetMultimap Methods: