public static boolean containsAllEntries(final InternalFloatLongMapOps map, Map<?, ?> another) { if (map == another) throw new IllegalArgumentException(); if (another instanceof FloatLongMap) { FloatLongMap m2 = (FloatLongMap) another; if (map.size() < m2.size()) return false; if (m2 instanceof InternalFloatLongMapOps) { //noinspection unchecked return ((InternalFloatLongMapOps) m2).allEntriesContainingIn(map); } return m2.forEachWhile(new FloatLongPredicate() { @Override public boolean test(float a, long b) { return map.containsEntry(a, b); } }); } for (Map.Entry<?, ?> e : another.entrySet()) { if (!map.containsEntry((Float) e.getKey(), (Long) e.getValue())) return false; } return true; }
public static void putAll(final InternalFloatLongMapOps map, Map<? extends Float, ? extends Long> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof FloatLongMap) { if (another instanceof InternalFloatLongMapOps) { ((InternalFloatLongMapOps) another).reversePutAllTo(map); } else { ((FloatLongMap) another).forEach(new FloatLongConsumer() { @Override public void accept(float key, long value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends Float, ? extends Long> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }
public static void putAll(final InternalFloatLongMapOps map, Map<? extends Float, ? extends Long> another) { if (map == another) throw new IllegalArgumentException(); long maxPossibleSize = map.sizeAsLong() + Containers.sizeAsLong(another); map.ensureCapacity(maxPossibleSize); if (another instanceof FloatLongMap) { if (another instanceof InternalFloatLongMapOps) { ((InternalFloatLongMapOps) another).reversePutAllTo(map); } else { ((FloatLongMap) another).forEach(new FloatLongConsumer() { @Override public void accept(float key, long value) { map.justPut(key, value); } }); } } else { for (Map.Entry<? extends Float, ? extends Long> e : another.entrySet()) { map.justPut(e.getKey(), e.getValue()); } } }
public static boolean containsAllEntries(final InternalFloatLongMapOps map, Map<?, ?> another) { if (map == another) throw new IllegalArgumentException(); if (another instanceof FloatLongMap) { FloatLongMap m2 = (FloatLongMap) another; if (map.size() < m2.size()) return false; if (m2 instanceof InternalFloatLongMapOps) { //noinspection unchecked return ((InternalFloatLongMapOps) m2).allEntriesContainingIn(map); } return m2.forEachWhile(new FloatLongPredicate() { @Override public boolean test(float a, long b) { return map.containsEntry(a, b); } }); } for (Map.Entry<?, ?> e : another.entrySet()) { if (!map.containsEntry((Float) e.getKey(), (Long) e.getValue())) return false; } return true; }