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