@Override public boolean test(short a, Object b) { return map.containsEntry(a, b); } });
@Override public void accept(short key, V value) { map.justPut(key, value); } });
public static <V> void putAll(final InternalShortObjMapOps<V> map, Map<? extends Short, ? extends V> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof ShortObjMap) { if (another instanceof InternalShortObjMapOps) { ((InternalShortObjMapOps) another).reversePutAllTo(map); } else { ((ShortObjMap) another).forEach(new ShortObjConsumer<V>() { @Override public void accept(short key, V value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends Short, ? extends V> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }
if ( m2.valueEquivalence().equals(map.valueEquivalence()) ) { if (map.size() < m2.size()) return false; if (m2 instanceof InternalShortObjMapOps) { return ((InternalShortObjMapOps) m2).allEntriesContainingIn(map); if (!map.containsEntry((Short) e.getKey(), e.getValue())) return false;
if ( m2.valueEquivalence().equals(map.valueEquivalence()) ) { if (map.size() < m2.size()) return false; if (m2 instanceof InternalShortObjMapOps) { return ((InternalShortObjMapOps) m2).allEntriesContainingIn(map); if (!map.containsEntry((Short) e.getKey(), e.getValue())) return false;
@Override public boolean test(short a, Object b) { return map.containsEntry(a, b); } });
@Override public void accept(short key, V value) { map.justPut(key, value); } });
public static <V> void putAll(final InternalShortObjMapOps<V> map, Map<? extends Short, ? extends V> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof ShortObjMap) { if (another instanceof InternalShortObjMapOps) { ((InternalShortObjMapOps) another).reversePutAllTo(map); } else { ((ShortObjMap) another).forEach(new ShortObjConsumer<V>() { @Override public void accept(short key, V value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends Short, ? extends V> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }
@Override public boolean allEntriesContainingIn(InternalShortObjMapOps<?> m) { if (this.isEmpty()) return true; boolean containsAll = true; short free = freeValue; short[] keys = set; V[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { short key; if ((key = keys[i]) != free) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break; } } } return containsAll; }
@Override public void reversePutAllTo(InternalShortObjMapOps<? super V> m) { if (this.isEmpty()) return; short free = freeValue; short[] keys = set; V[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { short key; if ((key = keys[i]) != free) { m.justPut(key, vals[i]); } } }
@Override public boolean allEntriesContainingIn(InternalShortObjMapOps<?> m) { if (this.isEmpty()) return true; boolean containsAll = true; short free = freeValue; short[] keys = set; V[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { short key; if ((key = keys[i]) != free) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break; } } } return containsAll; }
@Override public void reversePutAllTo(InternalShortObjMapOps<? super V> m) { if (this.isEmpty()) return; short free = freeValue; short[] keys = set; V[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { short key; if ((key = keys[i]) != free) { m.justPut(key, vals[i]); } } }
@Override public boolean allEntriesContainingIn(InternalShortObjMapOps<?> m) { if (this.isEmpty()) return true; boolean containsAll = true; short free = freeValue; short[] keys = set; V[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { short key; if ((key = keys[i]) != free) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break; } } } return containsAll; }
@Override public void reversePutAllTo(InternalShortObjMapOps<? super V> m) { if (this.isEmpty()) return; short free = freeValue; short[] keys = set; V[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { short key; if ((key = keys[i]) != free) { m.justPut(key, vals[i]); } } }
@Override public boolean allEntriesContainingIn(InternalShortObjMapOps<?> m) { if (this.isEmpty()) return true; boolean containsAll = true; short free = freeValue; short[] keys = set; V[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { short key; if ((key = keys[i]) != free) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break; } } } return containsAll; }
@Override public void reversePutAllTo(InternalShortObjMapOps<? super V> m) { if (this.isEmpty()) return; short free = freeValue; short[] keys = set; V[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { short key; if ((key = keys[i]) != free) { m.justPut(key, vals[i]); } } }
short key; if ((key = keys[i]) != free) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break; short key; if ((key = keys[i]) != free && key != removed) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break;
@Override public void reversePutAllTo(InternalShortObjMapOps<? super V> m) { if (this.isEmpty()) return; int mc = modCount(); short free = freeValue; short[] keys = set; V[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { short key; if ((key = keys[i]) != free) { m.justPut(key, vals[i]); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
short key; if ((key = keys[i]) != free) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break; short key; if ((key = keys[i]) != free && key != removed) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break;
@Override public void reversePutAllTo(InternalShortObjMapOps<? super V> m) { if (this.isEmpty()) return; int mc = modCount(); short free = freeValue; short[] keys = set; V[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { short key; if ((key = keys[i]) != free) { m.justPut(key, vals[i]); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }