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