@SuppressWarnings("unchecked") // reading field populated by writeObject @GwtIncompatible // java.io.ObjectInputStream private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); keyType = (Class<K>) stream.readObject(); setDelegates( WellBehavedMap.wrap(new EnumMap<K, V>(keyType)), new HashMap<V, K>(keyType.getEnumConstants().length * 3 / 2)); Serialization.populateMap(this, stream); }
@GwtIncompatible // java.io.ObjectInputStream private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); int distinctElements = Serialization.readCount(stream); setBackingMap(Maps.<E, Count>newHashMap()); Serialization.populateMultiset(this, stream, distinctElements); }
@GwtCompatible(serializable = true, emulated = true) public final class HashMultimap<K, V> extends HashMultimapGwtSerializationDependencies<K, V> { private static final int DEFAULT_VALUES_PER_KEY = 2; @VisibleForTesting transient int expectedValuesPerKey = DEFAULT_VALUES_PER_KEY; @GwtIncompatible // Not needed in emulated source private static final long serialVersionUID = 0;
@GwtIncompatible // java.io.ObjectOutputStream private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); expectedValuesPerKey = DEFAULT_VALUES_PER_KEY; int distinctKeys = Serialization.readCount(stream); Map<K, Collection<V>> map = Maps.newHashMap(); setMap(map); Serialization.populateMultimap(this, stream, distinctKeys); }
/** * @serialData the {@code Class<E>} for the enum type, the number of distinct elements, the first * element, its count, the second element, its count, and so on */ @GwtIncompatible // java.io.ObjectInputStream private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); @SuppressWarnings("unchecked") // reading data stored by writeObject Class<E> localType = (Class<E>) stream.readObject(); type = localType; enumConstants = type.getEnumConstants(); counts = new int[enumConstants.length]; Serialization.populateMultiset(this, stream); }
/** * @serialData the key class, number of entries, first key, first value, second key, second value, * and so on. */ @GwtIncompatible // java.io.ObjectOutputStream private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); stream.writeObject(keyType); Serialization.writeMap(this, stream); }
/** * @serialData number of distinct keys, and then for each distinct key: the key, the number of * values for that key, and the key's values */ @GwtIncompatible // java.io.ObjectOutputStream private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); stream.writeObject(valueComparator()); Serialization.writeMultimap(this, stream); }
@GwtIncompatible // java.io.ObjectOutputStream private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); stream.writeObject(type); Serialization.writeMultiset(this, stream); }
@GwtIncompatible // java.io.ObjectInputStream @SuppressWarnings("unchecked") // reading data stored by writeObject private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); keyComparator = checkNotNull((Comparator<? super K>) stream.readObject()); valueComparator = checkNotNull((Comparator<? super V>) stream.readObject()); setMap(new TreeMap<K, Collection<V>>(keyComparator)); Serialization.populateMultimap(this, stream); }
@GwtIncompatible("java.io.ObjectInputStream") private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); expectedValuesPerKey = stream.readInt(); int distinctKeys = Serialization.readCount(stream); Map<K, Collection<V>> map = Maps.newHashMapWithExpectedSize(distinctKeys); setMap(map); Serialization.populateMultimap(this, stream, distinctKeys); }
@GwtIncompatible // java.io.ObjectInputStream private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); int size = Serialization.readCount(stream); init(16); // resist hostile attempts to allocate gratuitous heap Serialization.populateMap(this, stream, size); }
@Beta @CanIgnoreReturnValue @GwtIncompatible public abstract class AbstractListeningExecutorService extends AbstractExecutorService implements ListeningExecutorService {
/** * @serialData expectedValuesPerKey, number of distinct keys, and then for each distinct key: the * key, number of values for that key, and the key's values */ @GwtIncompatible // java.io.ObjectOutputStream private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); Serialization.writeMultimap(this, stream); }
/** * Returns whether {@link #lazyStackTrace} will use the special implementation described in its * documentation. * * @since 19.0 */ @Beta @GwtIncompatible // getStackTraceElementMethod public static boolean lazyStackTraceIsLazy() { return getStackTraceElementMethod != null && getStackTraceDepthMethod != null; }
/** * @serialData the number of distinct elements, the first element, its count, the second element, * its count, and so on */ @GwtIncompatible // java.io.ObjectOutputStream private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); Serialization.writeMultiset(this, stream); }
/** * @serialData the number of entries, first key, first value, second key, second value, and so on. */ @GwtIncompatible // java.io.ObjectOutputStream private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); Serialization.writeMap(this, stream); }
@GwtCompatible(emulated = true) public final class Charsets { private Charsets() {} @GwtIncompatible // Charset not supported by GWT public static final Charset US_ASCII = Charset.forName("US-ASCII"); @GwtIncompatible // Charset not supported by GWT public static final Charset UTF_16BE = Charset.forName("UTF-16BE"); @GwtIncompatible // Charset not supported by GWT public static final Charset UTF_16LE = Charset.forName("UTF-16LE"); @GwtIncompatible // Charset not supported by GWT public static final Charset UTF_16 = Charset.forName("UTF-16");
@GwtIncompatible // java.io.ObjectInputStream private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); int distinctElements = Serialization.readCount(stream); setBackingMap(new LinkedHashMap<E, Count>()); Serialization.populateMultiset(this, stream, distinctElements); }
@GwtCompatible(serializable = true, emulated = true) public final class ArrayListMultimap<K, V> extends ArrayListMultimapGwtSerializationDependencies<K, V> { @VisibleForTesting transient int expectedValuesPerKey; @GwtIncompatible // Not needed in emulated source. private static final long serialVersionUID = 0;
@GwtIncompatible // java.io.ObjectInputStream private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); expectedValuesPerKey = DEFAULT_VALUES_PER_KEY; int distinctKeys = Serialization.readCount(stream); Map<K, Collection<V>> map = Platform.newHashMapWithExpectedSize(12); setMap(map); Serialization.populateMultimap(this, stream, distinctKeys); }