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(Multimap<? extends K, ? extends V> multimap) 

Source Link

Document

Constructs an ArrayListMultimap with the same mappings as the specified multimap.

Usage

From source file:org.dishevelled.bio.variant.vcf.header.VcfStructuredHeaderLine.java

/**
 * Parse the specified value into a structured VCF header line.
 *
 * @param value value, must not be null//from   w  ww. j  a  va  2  s  .co  m
 * @return the specified value parsed into a structured VCF header line
 */
public static VcfStructuredHeaderLine valueOf(final String value) {
    checkNotNull(value);
    checkArgument(isStructured(value));
    String name = value.substring(2, value.indexOf("="));
    ListMultimap<String, String> entries = parseEntries(value.replace("##" + name + "=", ""));

    String id = requiredString("ID", entries);

    ListMultimap<String, String> attributes = ArrayListMultimap.create(entries);
    attributes.removeAll("ID");

    return new VcfStructuredHeaderLine(name, id, attributes);
}

From source file:org.jesterj.ingest.model.impl.DocumentImpl.java

/**
 * Copy constructor. Creates a deep copy of raw data, so may be memory intensive.
 *
 * @param doc The original document to be copied.
 *//*from   w w w .  java2  s .  c  o m*/
public DocumentImpl(Document doc) {
    byte[] duplicate = new byte[doc.getRawData().length];
    System.arraycopy(doc.getRawData(), 0, duplicate, 0, doc.getRawData().length);
    this.rawData = duplicate;
    this.operation = doc.getOperation();
    this.delegate = ArrayListMultimap.create(doc.getDelegate());
    this.sourceScannerName = doc.getSourceScannerName();
    this.idField = doc.getIdField();
    this.status = doc.getStatus();
    this.statusMessage = doc.getStatusMessage();
}