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