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