@Override public boolean test(Object a, long b) { return map.containsEntry(a, b); } });
@Override public void accept(K key, long value) { map.justPut(key, value); } });
public static <K> void putAll(final InternalObjLongMapOps<K> map, Map<? extends K, ? extends Long> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof ObjLongMap) { if (another instanceof InternalObjLongMapOps) { ((InternalObjLongMapOps) another).reversePutAllTo(map); } else { ((ObjLongMap) another).forEach(new ObjLongConsumer<K>() { @Override public void accept(K key, long value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends K, ? extends Long> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }
ObjLongMap m2 = (ObjLongMap) another; if ( m2.keyEquivalence().equals(map.keyEquivalence()) if (map.size() < m2.size()) return false; if (m2 instanceof InternalObjLongMapOps) { return ((InternalObjLongMapOps) m2).allEntriesContainingIn(map); if (!map.containsEntry(e.getKey(), (Long) e.getValue())) return false;
ObjLongMap m2 = (ObjLongMap) another; if ( m2.keyEquivalence().equals(map.keyEquivalence()) if (map.size() < m2.size()) return false; if (m2 instanceof InternalObjLongMapOps) { return ((InternalObjLongMapOps) m2).allEntriesContainingIn(map); if (!map.containsEntry(e.getKey(), (Long) e.getValue())) return false;
@Override public void accept(K key, long value) { map.justPut(key, value); } });
@Override public boolean test(Object a, long b) { return map.containsEntry(a, b); } });
public static <K> void putAll(final InternalObjLongMapOps<K> map, Map<? extends K, ? extends Long> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof ObjLongMap) { if (another instanceof InternalObjLongMapOps) { ((InternalObjLongMapOps) another).reversePutAllTo(map); } else { ((ObjLongMap) another).forEach(new ObjLongConsumer<K>() { @Override public void accept(K key, long value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends K, ? extends Long> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }
@Override public void reversePutAllTo(InternalObjLongMapOps<? super K> m) { if (this.isEmpty()) return; Object[] keys = set; long[] 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 boolean allEntriesContainingIn(InternalObjLongMapOps<?> m) { if (this.isEmpty()) return true; boolean containsAll = true; Object[] keys = set; long[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break; } } } return containsAll; }
@Override public void reversePutAllTo(InternalObjLongMapOps<? super K> m) { if (this.isEmpty()) return; Object[] keys = set; long[] 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 boolean allEntriesContainingIn(InternalObjLongMapOps<?> m) { if (this.isEmpty()) return true; boolean containsAll = true; Object[] keys = set; long[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break; } } } return containsAll; }
@Override public void reversePutAllTo(InternalObjLongMapOps<? super K> m) { if (this.isEmpty()) return; Object[] keys = set; long[] 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 boolean allEntriesContainingIn(InternalObjLongMapOps<?> m) { if (this.isEmpty()) return true; boolean containsAll = true; Object[] keys = set; long[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break; } } } return containsAll; }
@Override public void reversePutAllTo(InternalObjLongMapOps<? super K> m) { if (this.isEmpty()) return; Object[] keys = set; long[] 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 boolean allEntriesContainingIn(InternalObjLongMapOps<?> m) { if (this.isEmpty()) return true; boolean containsAll = true; Object[] keys = set; long[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break; } } } return containsAll; }
@Override public void reversePutAllTo(InternalObjLongMapOps<? super K> m) { if (this.isEmpty()) return; int mc = modCount(); Object[] keys = set; long[] 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 boolean allEntriesContainingIn(InternalObjLongMapOps<?> m) { if (this.isEmpty()) return true; boolean containsAll = true; int mc = modCount(); Object[] keys = set; long[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { K key; // noinspection unchecked if ((key = (K) keys[i]) != FREE) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return containsAll; }
@Override public void reversePutAllTo(InternalObjLongMapOps<? super K> m) { if (this.isEmpty()) return; int mc = modCount(); Object[] keys = set; long[] 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(); }
if (!m.containsEntry(key, vals[i])) { containsAll = false; break; if (!m.containsEntry(key, vals[i])) { containsAll = false; break;