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