@Override public boolean test(float a, int b) { return map.containsEntry(a, b); } });
@Override public void accept(float key, int value) { map.justPut(key, value); } });
public static void putAll(final InternalFloatIntMapOps map, Map<? extends Float, ? extends Integer> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof FloatIntMap) { if (another instanceof InternalFloatIntMapOps) { ((InternalFloatIntMapOps) another).reversePutAllTo(map); } else { ((FloatIntMap) another).forEach(new FloatIntConsumer() { @Override public void accept(float key, int value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends Float, ? extends Integer> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }
public static boolean containsAllEntries(final InternalFloatIntMapOps map, Map<?, ?> another) { if (map == another) throw new IllegalArgumentException(); if (another instanceof FloatIntMap) { FloatIntMap m2 = (FloatIntMap) another; if (map.size() < m2.size()) return false; if (m2 instanceof InternalFloatIntMapOps) { //noinspection unchecked return ((InternalFloatIntMapOps) m2).allEntriesContainingIn(map); } return m2.forEachWhile(new FloatIntPredicate() { @Override public boolean test(float a, int b) { return map.containsEntry(a, b); } }); } for (Map.Entry<?, ?> e : another.entrySet()) { if (!map.containsEntry((Float) e.getKey(), (Integer) e.getValue())) return false; } return true; }
public static boolean containsAllEntries(final InternalFloatIntMapOps map, Map<?, ?> another) { if (map == another) throw new IllegalArgumentException(); if (another instanceof FloatIntMap) { FloatIntMap m2 = (FloatIntMap) another; if (map.size() < m2.size()) return false; if (m2 instanceof InternalFloatIntMapOps) { //noinspection unchecked return ((InternalFloatIntMapOps) m2).allEntriesContainingIn(map); } return m2.forEachWhile(new FloatIntPredicate() { @Override public boolean test(float a, int b) { return map.containsEntry(a, b); } }); } for (Map.Entry<?, ?> e : another.entrySet()) { if (!map.containsEntry((Float) e.getKey(), (Integer) e.getValue())) return false; } return true; }
@Override public void accept(float key, int value) { map.justPut(key, value); } });
@Override public boolean test(float a, int b) { return map.containsEntry(a, b); } });
public static void putAll(final InternalFloatIntMapOps map, Map<? extends Float, ? extends Integer> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof FloatIntMap) { if (another instanceof InternalFloatIntMapOps) { ((InternalFloatIntMapOps) another).reversePutAllTo(map); } else { ((FloatIntMap) another).forEach(new FloatIntConsumer() { @Override public void accept(float key, int value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends Float, ? extends Integer> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }
@Override public void reversePutAllTo(InternalFloatIntMapOps m) { if (this.isEmpty()) return; long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { int key; if ((key = (int) (entry = tab[i])) < FREE_BITS) { m.justPut(key, (int) (entry >>> 32)); } } }
@Override public boolean allEntriesContainingIn(InternalFloatIntMapOps m) { if (this.isEmpty()) return true; boolean containsAll = true; long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { int key; if ((key = (int) (entry = tab[i])) < FREE_BITS) { if (!m.containsEntry(key, (int) (entry >>> 32))) { containsAll = false; break; } } } return containsAll; }
@Override public void reversePutAllTo(InternalFloatIntMapOps m) { if (this.isEmpty()) return; long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { int key; if ((key = (int) (entry = tab[i])) < FREE_BITS) { m.justPut(key, (int) (entry >>> 32)); } } }
@Override public boolean allEntriesContainingIn(InternalFloatIntMapOps m) { if (this.isEmpty()) return true; boolean containsAll = true; long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { int key; if ((key = (int) (entry = tab[i])) < FREE_BITS) { if (!m.containsEntry(key, (int) (entry >>> 32))) { containsAll = false; break; } } } return containsAll; }
@Override public void reversePutAllTo(InternalFloatIntMapOps m) { if (this.isEmpty()) return; long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { int key; if ((key = (int) (entry = tab[i])) < FREE_BITS) { m.justPut(key, (int) (entry >>> 32)); } } }
@Override public boolean allEntriesContainingIn(InternalFloatIntMapOps m) { if (this.isEmpty()) return true; boolean containsAll = true; long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { int key; if ((key = (int) (entry = tab[i])) < FREE_BITS) { if (!m.containsEntry(key, (int) (entry >>> 32))) { containsAll = false; break; } } } return containsAll; }
@Override public void reversePutAllTo(InternalFloatIntMapOps m) { if (this.isEmpty()) return; long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { int key; if ((key = (int) (entry = tab[i])) < FREE_BITS) { m.justPut(key, (int) (entry >>> 32)); } } }
@Override public boolean allEntriesContainingIn(InternalFloatIntMapOps m) { if (this.isEmpty()) return true; boolean containsAll = true; long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { int key; if ((key = (int) (entry = tab[i])) < FREE_BITS) { if (!m.containsEntry(key, (int) (entry >>> 32))) { containsAll = false; break; } } } return containsAll; }
@Override public void reversePutAllTo(InternalFloatIntMapOps m) { if (this.isEmpty()) return; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { int key; if ((key = (int) (entry = tab[i])) < FREE_BITS) { m.justPut(key, (int) (entry >>> 32)); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
@Override public boolean allEntriesContainingIn(InternalFloatIntMapOps m) { if (this.isEmpty()) return true; boolean containsAll = true; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { int key; if ((key = (int) (entry = tab[i])) < FREE_BITS) { if (!m.containsEntry(key, (int) (entry >>> 32))) { containsAll = false; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return containsAll; }
@Override public void reversePutAllTo(InternalFloatIntMapOps m) { if (this.isEmpty()) return; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { int key; if ((key = (int) (entry = tab[i])) < FREE_BITS) { m.justPut(key, (int) (entry >>> 32)); } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); }
@Override public boolean allEntriesContainingIn(InternalFloatIntMapOps m) { if (this.isEmpty()) return true; boolean containsAll = true; int mc = modCount(); long[] tab = table; long entry; for (int i = tab.length - 1; i >= 0; i--) { int key; if ((key = (int) (entry = tab[i])) < FREE_BITS) { if (!m.containsEntry(key, (int) (entry >>> 32))) { containsAll = false; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return containsAll; }