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