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