@Override public void putAll(@Nonnull Map<? extends Long, ? extends T> m) { if (KolobokeLongEntityMap.identical(KolobokeLongEntityMap.this, m)) throw new IllegalArgumentException(); long maxPossibleSize = (sizeAsLong()) + (Containers.sizeAsLong(m)); ensureCapacity(maxPossibleSize); if (m instanceof LongObjMap) { if ((InternalLongObjMapOps.class.isAssignableFrom(getClass())) && (m instanceof InternalLongObjMapOps)) { ((InternalLongObjMapOps) (m)).reversePutAllTo(((InternalLongObjMapOps<? super T>) (InternalLongObjMapOps.class.cast(KolobokeLongEntityMap.this)))); } else { ((LongObjMap) (m)).forEach(new LongObjConsumer<T>() { @Override public void accept(long key, T value) { justPut(key, value); } }); } } else { for (Map.Entry<? extends Long, ? extends T> e : m.entrySet()) { justPut(e.getKey(), e.getValue()); } } }
public static <V> void putAll(final InternalLongObjMapOps<V> map, Map<? extends Long, ? extends V> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof LongObjMap) { if (another instanceof InternalLongObjMapOps) { ((InternalLongObjMapOps) another).reversePutAllTo(map); } else { ((LongObjMap) another).forEach(new LongObjConsumer<V>() { @Override public void accept(long key, V value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends Long, ? extends V> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }
public static <V> void putAll(final InternalLongObjMapOps<V> map, Map<? extends Long, ? extends V> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof LongObjMap) { if (another instanceof InternalLongObjMapOps) { ((InternalLongObjMapOps) another).reversePutAllTo(map); } else { ((LongObjMap) another).forEach(new LongObjConsumer<V>() { @Override public void accept(long key, V value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends Long, ? extends V> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }