All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.common.collect..ImmutableListMultimap.swp Maven / Gradle / Ivy

Go to download

Guava is a suite of core and expanded libraries that include utility classes, google's collections, io classes, and much much more.

There is a newer version: 33.1.0-jre
Show newest version
b0VIM 8.1?&?\?%?%?cpovirktwelfth.pit.corp.google.com~cpovirk/clients/guava-black/guava/guava/src/com/google/common/collect/ImmutableListMultimap.java
3210#"! Utp^????????W_??????????????????c;`?ad8?^????K ???`?
?
?
?
?
?
A
@

??~????iF)?
?
?
?
o
O



?	?	~	K	??????>?QB=?wra\K?_ZA<???h<%??h0???6?????  /**  }        ImmutableListMultimap.Builder::build);        ImmutableListMultimap.Builder::combine,        (builder, t) -> builder.put(keyFunction.apply(t), valueFunction.apply(t)),        ImmutableListMultimap::builder,    return Collector.of(    checkNotNull(valueFunction, "valueFunction");    checkNotNull(keyFunction, "keyFunction");      Function valueFunction) {      Function keyFunction,  public static  Collector> toImmutableListMultimap(   */   * @since 21.0   *   * }
* .build(); * .putAll('c', "arrot", "herry") * .putAll('a', "pple", "sparagus") * .put('b', "anana") * new ImmutableListMultimap.Builder() * static final Multimap FIRST_LETTER_MULTIMAP = * * // is equivalent to * * .collect(toImmutableListMultimap(str -> str.charAt(0), str -> str.substring(1))); * Stream.of("banana", "apple", "carrot", "asparagus", "cherry") * static final Multimap FIRST_LETTER_MULTIMAP = *
{@code   *   * 

Example: * * is preserved, but entries are grouped by key. *

For streams with {@linkplain java.util.stream#Ordering defined encounter order}, that order * * elements. * whose keys and values are the result of applying the provided mapping functions to the input * Returns a {@link Collector} that accumulates elements into an {@code ImmutableListMultimap} /** implements ListMultimap {public class ImmutableListMultimap extends ImmutableMultimap@GwtCompatible(serializable = true, emulated = true) */ * @since 2.0 * @author Jared Levy * * "https://github.com/google/guava/wiki/ImmutableCollectionsExplained"> immutable collections. *

See the Guava User Guide article on > tmpMap; } tmpSize += valueCount; builder.put(key, valuesBuilder.build()); } valuesBuilder.add(stream.readObject()); for (int j = 0; j < valueCount; j++) { ImmutableList.Builder valuesBuilder = ImmutableList.builder(); } throw new InvalidObjectException("Invalid value count " + valueCount); if (valueCount <= 0) { int valueCount = stream.readInt(); Object key = stream.readObject(); for (int i = 0; i < keyCount; i++) { int tmpSize = 0; ImmutableMap.Builder> builder = ImmutableMap.builder(); } throw new InvalidObjectException("Invalid key count " + keyCount); if (keyCount < 0) { int keyCount = stream.readInt(); stream.defaultReadObject(); private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { @GwtIncompatible // java.io.ObjectInputStream } Serialization.writeMultimap(this, stream); stream.defaultWriteObject(); private void writeObject(ObjectOutputStream stream) throws IOException { @GwtIncompatible // java.io.ObjectOutputStream */ * values for that key, and the key's values * @serialData number of distinct keys, and then for each distinct key: the key, the number of /** } throw new UnsupportedOperationException(); public ImmutableList replaceValues(K key, Iterable values) { @Override @Deprecated @CanIgnoreReturnValue */ * @deprecated Unsupported operation. * @throws UnsupportedOperationException always * * Guaranteed to throw an exception and leave the multimap unmodified. /** } throw new UnsupportedOperationException(); public ImmutableList removeAll(Object key) { @Override @Deprecated @CanIgnoreReturnValue */ * @deprecated Unsupported operation. * @throws UnsupportedOperationException always * * Guaranteed to throw an exception and leave the multimap unmodified. /** } return invertedMultimap; invertedMultimap.inverse = this; ImmutableListMultimap invertedMultimap = builder.build(); } builder.put(entry.getValue(), entry.getKey()); for (Entry entry : entries()) { Builder builder = builder(); private ImmutableListMultimap invert() { } return (result == null) ? (inverse = invert()) : result; ImmutableListMultimap result = inverse; public ImmutableListMultimap inverse() { @Override */ * @since 11.0 * * ImmutableMultimap} specified in the {@code ImmutableMultimap} class. * value, this method returns an {@code ImmutableListMultimap} rather than the {@code