@Override public boolean test(int a, long b) { return map.containsEntry(a, b); } });
@Override public void accept(int key, long value) { map.justPut(key, value); } });
public static void putAll(final InternalIntLongMapOps map, Map<? extends Integer, ? extends Long> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof IntLongMap) { if (another instanceof InternalIntLongMapOps) { ((InternalIntLongMapOps) another).reversePutAllTo(map); } else { ((IntLongMap) another).forEach(new IntLongConsumer() { @Override public void accept(int key, long value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends Integer, ? extends Long> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }
public static boolean containsAllEntries(final InternalIntLongMapOps map, Map<?, ?> another) { if (map == another) throw new IllegalArgumentException(); if (another instanceof IntLongMap) { IntLongMap m2 = (IntLongMap) another; if (map.size() < m2.size()) return false; if (m2 instanceof InternalIntLongMapOps) { //noinspection unchecked return ((InternalIntLongMapOps) m2).allEntriesContainingIn(map); } return m2.forEachWhile(new IntLongPredicate() { @Override public boolean test(int a, long b) { return map.containsEntry(a, b); } }); } for (Map.Entry<?, ?> e : another.entrySet()) { if (!map.containsEntry((Integer) e.getKey(), (Long) e.getValue())) return false; } return true; }
public static boolean containsAllEntries(final InternalIntLongMapOps map, Map<?, ?> another) { if (map == another) throw new IllegalArgumentException(); if (another instanceof IntLongMap) { IntLongMap m2 = (IntLongMap) another; if (map.size() < m2.size()) return false; if (m2 instanceof InternalIntLongMapOps) { //noinspection unchecked return ((InternalIntLongMapOps) m2).allEntriesContainingIn(map); } return m2.forEachWhile(new IntLongPredicate() { @Override public boolean test(int a, long b) { return map.containsEntry(a, b); } }); } for (Map.Entry<?, ?> e : another.entrySet()) { if (!map.containsEntry((Integer) e.getKey(), (Long) e.getValue())) return false; } return true; }
@Override public void accept(int key, long value) { map.justPut(key, value); } });
@Override public boolean test(int a, long b) { return map.containsEntry(a, b); } });
public static void putAll(final InternalIntLongMapOps map, Map<? extends Integer, ? extends Long> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof IntLongMap) { if (another instanceof InternalIntLongMapOps) { ((InternalIntLongMapOps) another).reversePutAllTo(map); } else { ((IntLongMap) another).forEach(new IntLongConsumer() { @Override public void accept(int key, long value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends Integer, ? extends Long> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }
@Override public void reversePutAllTo(InternalIntLongMapOps m) { if (this.isEmpty()) return; int free = freeValue; int[] keys = set; long[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) != free) { m.justPut(key, vals[i]); } } }
@Override public boolean allEntriesContainingIn(InternalIntLongMapOps m) { if (this.isEmpty()) return true; boolean containsAll = true; int free = freeValue; int[] keys = set; long[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) != free) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break; } } } return containsAll; }
@Override public void reversePutAllTo(InternalIntLongMapOps m) { if (this.isEmpty()) return; int free = freeValue; int[] keys = set; long[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) != free) { m.justPut(key, vals[i]); } } }
@Override public boolean allEntriesContainingIn(InternalIntLongMapOps m) { if (this.isEmpty()) return true; boolean containsAll = true; int free = freeValue; int[] keys = set; long[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) != free) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break; } } } return containsAll; }
@Override public void reversePutAllTo(InternalIntLongMapOps m) { if (this.isEmpty()) return; int free = freeValue; int[] keys = set; long[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) != free) { m.justPut(key, vals[i]); } } }
@Override public boolean allEntriesContainingIn(InternalIntLongMapOps m) { if (this.isEmpty()) return true; boolean containsAll = true; int free = freeValue; int[] keys = set; long[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) != free) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break; } } } return containsAll; }
@Override public void reversePutAllTo(InternalIntLongMapOps m) { if (this.isEmpty()) return; int free = freeValue; int[] keys = set; long[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) != free) { m.justPut(key, vals[i]); } } }
@Override public boolean allEntriesContainingIn(InternalIntLongMapOps m) { if (this.isEmpty()) return true; boolean containsAll = true; int free = freeValue; int[] keys = set; long[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) != free) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break; } } } return containsAll; }
@Override public void reversePutAllTo(InternalIntLongMapOps m) { if (this.isEmpty()) return; int mc = modCount(); int free = freeValue; int[] keys = set; long[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) != free) { m.justPut(key, vals[i]); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
int key; if ((key = keys[i]) != free) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break; int key; if ((key = keys[i]) != free && key != removed) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break;
@Override public void reversePutAllTo(InternalIntLongMapOps m) { if (this.isEmpty()) return; int mc = modCount(); int free = freeValue; int removed = removedValue; int[] keys = set; long[] vals = values; if (noRemoved()) { for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) != free) { m.justPut(key, vals[i]); } } } else { for (int i = keys.length - 1; i >= 0; i--) { int key; if ((key = keys[i]) != free && key != removed) { m.justPut(key, vals[i]); } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
int key; if ((key = keys[i]) != free) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break; int key; if ((key = keys[i]) != free && key != removed) { if (!m.containsEntry(key, vals[i])) { containsAll = false; break;