Example usage for com.google.common.collect ArrayListMultimap create

List of usage examples for com.google.common.collect ArrayListMultimap create

Introduction

In this page you can find the example usage for com.google.common.collect ArrayListMultimap create.

Prototype

public static <K, V> ArrayListMultimap<K, V> create() 

Source Link

Document

Creates a new, empty ArrayListMultimap with the default initial capacities.

Usage

From source file:com.android.tools.idea.gradle.project.LibraryAttachments.java

public static void removeLibrariesAndStoreAttachments(@NotNull Project project) {
    LibraryTable libraryTable = ProjectLibraryTable.getInstance(project);
    LibraryTable.ModifiableModel model = libraryTable.getModifiableModel();
    try {/*  w  w  w . ja  v  a 2 s  .  c  o m*/
        Map<OrderRootType, Multimap<String, String>> attachmentsByType = Maps.newHashMap();

        for (Library library : model.getLibraries()) {
            for (OrderRootType type : SUPPORTED_TYPES) {
                Multimap<String, String> attachments = ArrayListMultimap.create();
                String name = library.getName();
                if (name != null) {
                    String[] urls = library.getUrls(type);
                    for (String url : urls) {
                        attachments.put(name, url);
                    }
                }
                attachmentsByType.put(type, attachments);
            }
            model.removeLibrary(library);
        }
        project.putUserData(LIBRARY_ATTACHMENTS, new LibraryAttachments(project, attachmentsByType));
    } finally {
        model.commit();
    }
}

From source file:com.android.tools.adtui.workbench.WorkBenchManager.java

public WorkBenchManager() {
    myWorkBenches = Multimaps.synchronizedListMultimap(ArrayListMultimap.create());
}

From source file:com.ardor3d.util.scenegraph.DisplayListDelegate.java

public static void cleanAllDisplayLists(final Renderer deleter) {
    final Multimap<Object, Integer> idMap = ArrayListMultimap.create();

    // gather up expired Display Lists... these don't exist in our cache
    gatherGCdIds(idMap);/*from  w w  w.  j  a va  2 s  .com*/

    // Walk through the cached items and delete those too.
    for (final DisplayListDelegate buf : _identityCache.keySet()) {
        // Add id to map
        idMap.put(buf._id.getGlContext(), buf._id.getId());
    }

    handleDisplayListDelete(deleter, idMap);
}

From source file:org.shaf.core.io.emulator.InternalWriter.java

/**
 * Constructs a new memory writer.//from   ww  w . ja  v  a  2s. c om
 * 
 * @param config
 *            the writer configuration.
 */
public InternalWriter(final Configuration config) {
    super(config);

    this.buffer = ArrayListMultimap.create();
}

From source file:baggage.ListBag.java

@Override
protected Multimap<K, V> makeEmptyMap() {
    return ArrayListMultimap.create();
}

From source file:forestry.core.items.ItemElectronTube.java

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override//from  w w  w  .  ja va2 s . co m
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) {

    Multimap<ICircuitLayout, ICircuit> circuits = ArrayListMultimap.create();
    for (ICircuitLayout circuitLayout : ChipsetManager.circuitRegistry.getRegisteredLayouts().values()) {
        ICircuit circuit = ItemSolderingIron.SolderManager.getCircuit(circuitLayout, itemstack);
        if (circuit != null) {
            circuits.put(circuitLayout, circuit);
        }
    }

    if (circuits.size() > 0) {
        if (Proxies.common.isShiftDown()) {
            for (ICircuitLayout circuitLayout : circuits.keys()) {
                String circuitLayoutName = circuitLayout.getUsage();
                list.add(
                        EnumChatFormatting.WHITE.toString() + EnumChatFormatting.UNDERLINE + circuitLayoutName);
                for (ICircuit circuit : circuits.get(circuitLayout)) {
                    circuit.addTooltip(list);
                }
            }
        } else {
            list.add(EnumChatFormatting.ITALIC + "<" + StringUtil.localize("gui.tooltip.tmi") + ">");
        }
    } else {
        list.add("<" + StringUtil.localize("gui.noeffect") + ">");
    }
}

From source file:zmq.PollerBase.java

protected PollerBase() {
    load = new AtomicInteger(0);
    timers = ArrayListMultimap.create();
    addingTimers = ArrayListMultimap.create();
}

From source file:org.sonar.server.qualityprofile.BuiltInProfiles.java

public BuiltInProfiles() {
    this.namesByLang = ArrayListMultimap.create();
}

From source file:com.jivesoftware.os.tasmo.configuration.ViewModelParser.java

public List<ViewBinding> parse(List<String> modelPathtrings, boolean idCentric) {
    ArrayListMultimap<String, ModelPath> viewBindings = ArrayListMultimap.create();

    for (String simpleBinding : modelPathtrings) {
        String[] class_pathId_modelPath = toStringArray(simpleBinding, "::");
        List<ModelPath> bindings = viewBindings.get(class_pathId_modelPath[0].trim());

        try {/*from  w  ww .  ja v a  2s.co  m*/
            bindings.add(buildPath(class_pathId_modelPath[1].trim(), class_pathId_modelPath[2].trim()));
        } catch (Throwable t) {
            t.printStackTrace(System.out);
        }
    }

    List<ViewBinding> viewBindingsList = Lists.newArrayList();
    for (Map.Entry<String, Collection<ModelPath>> entry : viewBindings.asMap().entrySet()) {
        viewBindingsList.add(new ViewBinding(entry.getKey(), new ArrayList<>(entry.getValue()), false,
                idCentric, true, null));
    }

    return viewBindingsList;
}

From source file:org.sonar.core.issue.DefaultIssuable.java

public DefaultIssuable(List<Issue> issues) {
    this.issues = issues;
    this.issuesWithChangelogs = ArrayListMultimap.create();
}