/** * @param <V> * @param map * @return empty().plusAll(map) */ @SuppressWarnings("unchecked") public static <V> IntTreePMap<V> from(final Map<? extends Integer, ? extends V> map) { if(map instanceof IntTreePMap) return (IntTreePMap<V>)map; //(actually we only know it's IntTreePMap<? extends V>) // but that's good enough for an immutable // (i.e. we can't mess someone else up by adding the wrong type to it) return IntTreePMap.<V>empty().plusAll(map); }
/** * @param <V> * @param map * @return empty().plusAll(map) */ @SuppressWarnings("unchecked") public static <V> IntTreePMap<V> from(final Map<? extends Integer, ? extends V> map) { if(map instanceof IntTreePMap) return (IntTreePMap<V>)map; //(actually we only know it's IntTreePMap<? extends V>) // but that's good enough for an immutable // (i.e. we can't mess someone else up by adding the wrong type to it) return IntTreePMap.<V>empty().plusAll(map); }
/** * @param <V> * @param map * @return empty().plusAll(map) */ @SuppressWarnings("unchecked") public static <V> IntTreePMap<V> from(final Map<? extends Integer, ? extends V> map) { if(map instanceof IntTreePMap) return (IntTreePMap<V>)map; //(actually we only know it's IntTreePMap<? extends V>) // but that's good enough for an immutable // (i.e. we can't mess someone else up by adding the wrong type to it) return IntTreePMap.<V>empty().plusAll(map); }
/** * @param <V> * @param map * @return empty().plusAll(map) */ @SuppressWarnings("unchecked") public static <V> IntTreePMap<V> from(final Map<? extends Integer, ? extends V> map) { if (map instanceof IntTreePMap) return (IntTreePMap<V>) map; //(actually we only know it's IntTreePMap<? extends V>) // but that's good enough for an immutable // (i.e. we can't mess someone else up by adding the wrong type to it) return IntTreePMap.<V>empty().plusAll(map); }