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