@Override public void accept(K key, short value) { map.justPut(key, value); } });
@Override public void accept(K key, short value) { map.justPut(key, value); } });
@Override public void reversePutAllTo(InternalObjShortMapOps<? super K> m) { if (this.isEmpty()) return; Object[] keys = set; short[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE) { m.justPut(key, vals[i]); } } }
@Override public void reversePutAllTo(InternalObjShortMapOps<? super K> m) { if (this.isEmpty()) return; Object[] keys = set; short[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE) { m.justPut(key, vals[i]); } } }
@Override public void reversePutAllTo(InternalObjShortMapOps<? super K> m) { if (this.isEmpty()) return; Object[] keys = set; short[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE) { m.justPut(key, vals[i]); } } }
@Override public void reversePutAllTo(InternalObjShortMapOps<? super K> m) { if (this.isEmpty()) return; Object[] keys = set; short[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE) { m.justPut(key, vals[i]); } } }
@Override public void reversePutAllTo(InternalObjShortMapOps<? super K> m) { if (this.isEmpty()) return; int mc = modCount(); Object[] keys = set; short[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE) { m.justPut(key, vals[i]); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
@Override public void reversePutAllTo(InternalObjShortMapOps<? super K> m) { if (this.isEmpty()) return; int mc = modCount(); Object[] keys = set; short[] vals = values; if (noRemoved()) { for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE) { m.justPut(key, vals[i]); } } } else { for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE && key != REMOVED) { m.justPut(key, vals[i]); } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
@Override public void reversePutAllTo(InternalObjShortMapOps<? super K> m) { if (this.isEmpty()) return; int mc = modCount(); Object[] keys = set; short[] vals = values; if (noRemoved()) { for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE) { m.justPut(key, vals[i]); } } } else { for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE && key != REMOVED) { m.justPut(key, vals[i]); } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
@Override public void reversePutAllTo(InternalObjShortMapOps<? super K> m) { if (this.isEmpty()) return; int mc = modCount(); Object[] keys = set; short[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE) { m.justPut(key, vals[i]); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
@Override public void reversePutAllTo(InternalObjShortMapOps<? super K> m) { if (this.isEmpty()) return; int mc = modCount(); Object[] keys = set; short[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE) { m.justPut(key, vals[i]); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
@Override public void reversePutAllTo(InternalObjShortMapOps<? super K> m) { if (this.isEmpty()) return; int mc = modCount(); Object[] keys = set; short[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE) { m.justPut(key, vals[i]); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
@Override public void reversePutAllTo(InternalObjShortMapOps<? super K> m) { if (this.isEmpty()) return; int mc = modCount(); Object[] keys = set; short[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE) { m.justPut(key, vals[i]); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
@Override public void reversePutAllTo(InternalObjShortMapOps<? super K> m) { if (this.isEmpty()) return; int mc = modCount(); Object[] keys = set; short[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE) { m.justPut(key, vals[i]); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
public static <K> void putAll(final InternalObjShortMapOps<K> map, Map<? extends K, ? extends Short> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof ObjShortMap) { if (another instanceof InternalObjShortMapOps) { ((InternalObjShortMapOps) another).reversePutAllTo(map); } else { ((ObjShortMap) another).forEach(new ObjShortConsumer<K>() { @Override public void accept(K key, short value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends K, ? extends Short> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }
public static <K> void putAll(final InternalObjShortMapOps<K> map, Map<? extends K, ? extends Short> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof ObjShortMap) { if (another instanceof InternalObjShortMapOps) { ((InternalObjShortMapOps) another).reversePutAllTo(map); } else { ((ObjShortMap) another).forEach(new ObjShortConsumer<K>() { @Override public void accept(K key, short value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends K, ? extends Short> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }