/** * Constructs a new empty mutable map of the default expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap() newMutableMap()}. * * @param <K> the key type of the returned map * @return a new empty mutable map */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap() { return getDefaultFactory().<K>newMutableMap(); }
/** * Constructs a new empty mutable map of the default expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap() newMutableMap()}. * * @param <K> the key type of the returned map * @return a new empty mutable map */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap() { return getDefaultFactory().<K>newMutableMap(); }
/** * Constructs a new empty mutable map of the given expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap(int) newMutableMap(expectedSize)}. * * @param expectedSize the expected size of the returned map * @param <K> the key type of the returned map * @return a new empty mutable map of the given expected size */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap(int expectedSize) { return getDefaultFactory().<K>newMutableMap(expectedSize); }
/** * Constructs a new empty mutable map of the given expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap(int) newMutableMap(expectedSize)}. * * @param expectedSize the expected size of the returned map * @param <K> the key type of the returned map * @return a new empty mutable map of the given expected size */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap(int expectedSize) { return getDefaultFactory().<K>newMutableMap(expectedSize); }
/** * Constructs a new mutable map with the same mappings as the specified {@code map}. * * * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap( * Map) newMutableMap(map)}. * * @param map the map whose mappings are to be placed in the returned map * * @param <K> the key type of the returned map * @return a new mutable map with the same mappings as the specified {@code map} */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap( @Nonnull Map<? extends K, Long> map) { return getDefaultFactory().<K>newMutableMap(map); }
/** * Constructs a new mutable map which merge the mappings of the specified maps. On conflict, * mappings from the {@code map2} have priority over mappings from the {@code map1} with * the same keys. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap(Map, * Map, int) newMutableMap(map1, map2, expectedSize)}. * * @param map1 the first map to merge * @param map2 the second map to merge * @param expectedSize the expected size of the returned map * @param <K> the key type of the returned map * @return a new mutable map which merge the mappings of the specified maps */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap( @Nonnull Map<? extends K, Long> map1, @Nonnull Map<? extends K, Long> map2, int expectedSize) { return getDefaultFactory().<K>newMutableMap(map1, map2, expectedSize); }
/** * Constructs a new mutable map with the same mappings as the specified {@code map}. * * * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap( * Map) newMutableMap(map)}. * * @param map the map whose mappings are to be placed in the returned map * * @param <K> the key type of the returned map * @return a new mutable map with the same mappings as the specified {@code map} */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap( @Nonnull Map<? extends K, Long> map) { return getDefaultFactory().<K>newMutableMap(map); }
/** * Constructs a new mutable map filled with mappings consumed by the callback within the given * closure. Mappings supplied later within the closure have priority over the mappings * passed earlier with the same keys. * * <p>Example: TODO * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap( * Consumer) newMutableMap(entriesSupplier)}. * * @param entriesSupplier the function which supply mappings for the returned map via * the callback passed in * * @param <K> the key type of the returned map * @return a new mutable map with mappings consumed by the callback within the given closure */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap(@Nonnull Consumer<com.koloboke.function.ObjLongConsumer<K>> entriesSupplier ) { return getDefaultFactory().<K>newMutableMap(entriesSupplier); }
/** * Constructs a new mutable map with the given mappings, i. e. pairs of elements from * the {@code keys} and {@code values} arrays at the same index. If {@code keys} array have * duplicate elements, value corresponding the key with the highest index is left * in the returned map. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap(Object[], long[], int * ) newMutableMap(keys, values, expectedSize)}. * * @param keys the keys of the returned map * @param values the values of the returned map, each value is associated with the element * of the {@code keys} array at the same index * @param expectedSize the expected size of the returned map * @param <K> the key type of the returned map * @return a new mutable map with the given mappings * @throws IllegalArgumentException if {@code keys} and {@code values} arrays have different * length */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap( @Nonnull K[] keys, @Nonnull long[] values, int expectedSize) { return getDefaultFactory().<K>newMutableMap(keys, values, expectedSize); }
/** * Constructs a new mutable map with the given mappings, i. e. pairs of elements from * the {@code keys} and {@code values} iterables at the same iteration position. If {@code keys} * have duplicate elements, value corresponding the key appeared last in the iteration is left * in the returned map. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap(Iterable, Iterable, int * ) newMutableMap(keys, values, expectedSize)}. * * @param keys the keys of the returned map * @param values the values of the returned map, each value is associated with the element * of the {@code keys} iterable at the same iteration position * @param expectedSize the expected size of the returned map * @param <K> the key type of the returned map * @return a new mutable map with the given mappings * @throws IllegalArgumentException if {@code keys} and {@code values} have different size */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap( @Nonnull Iterable<? extends K> keys, @Nonnull Iterable<Long> values , int expectedSize) { return getDefaultFactory().<K>newMutableMap(keys, values, expectedSize); }
/** * Constructs a new mutable map which merge the mappings of the specified maps. On conflict, * mappings from the maps passed later in the argument list have priority over mappings * from the maps passed earlier with the same keys. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap(Map, Map, * Map, Map, int) newMutableMap(map1, map2, map3, map4, expectedSize)}. * * @param map1 the first map to merge * @param map2 the second map to merge * @param map3 the third map to merge * @param map4 the fourth map to merge * @param expectedSize the expected size of the returned map * @param <K> the key type of the returned map * @return a new mutable map which merge the mappings of the specified maps */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap( @Nonnull Map<? extends K, Long> map1, @Nonnull Map<? extends K, Long> map2, @Nonnull Map<? extends K, Long> map3, @Nonnull Map<? extends K, Long> map4, int expectedSize) { return getDefaultFactory().<K>newMutableMap(map1, map2, map3, map4, expectedSize); }
/** * Constructs a new mutable map which merge the mappings of the specified maps. On conflict, * mappings from the {@code map2} have priority over mappings from the {@code map1} with * the same keys. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap(Map, * Map) newMutableMap(map1, map2)}. * * @param map1 the first map to merge * @param map2 the second map to merge * * @param <K> the key type of the returned map * @return a new mutable map which merge the mappings of the specified maps */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap( @Nonnull Map<? extends K, Long> map1, @Nonnull Map<? extends K, Long> map2) { return getDefaultFactory().<K>newMutableMap(map1, map2); }
/** * Constructs a new mutable map which merge the mappings of the specified maps. On conflict, * mappings from the {@code map2} have priority over mappings from the {@code map1} with * the same keys. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap(Map, * Map, int) newMutableMap(map1, map2, expectedSize)}. * * @param map1 the first map to merge * @param map2 the second map to merge * @param expectedSize the expected size of the returned map * @param <K> the key type of the returned map * @return a new mutable map which merge the mappings of the specified maps */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap( @Nonnull Map<? extends K, Long> map1, @Nonnull Map<? extends K, Long> map2, int expectedSize) { return getDefaultFactory().<K>newMutableMap(map1, map2, expectedSize); }
/** * Constructs a new mutable map which merge the mappings of the specified maps. On conflict, * mappings from the {@code map2} have priority over mappings from the {@code map1} with * the same keys. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap(Map, * Map) newMutableMap(map1, map2)}. * * @param map1 the first map to merge * @param map2 the second map to merge * * @param <K> the key type of the returned map * @return a new mutable map which merge the mappings of the specified maps */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap( @Nonnull Map<? extends K, Long> map1, @Nonnull Map<? extends K, Long> map2) { return getDefaultFactory().<K>newMutableMap(map1, map2); }
/** * Constructs a new mutable map with the same mappings as the specified {@code map}. * * * <p>If the specified map is an instance of {@code ObjLongMap} and has the same * {@linkplain ObjLongMap#keyEquivalence() key equivalence} with this factory (and thus * the constructed map), the {@code expectedSize} argument is ignored. * * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap( * Map, int) newMutableMap(map, expectedSize)}. * * @param map the map whose mappings are to be placed in the returned map * @param expectedSize the expected size of the returned map * @param <K> the key type of the returned map * @return a new mutable map with the same mappings as the specified {@code map} */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap( @Nonnull Map<? extends K, Long> map, int expectedSize) { return getDefaultFactory().<K>newMutableMap(map, expectedSize); }
/** * Constructs a new mutable map which merge the mappings of the specified maps. On conflict, * mappings from the maps passed later in the argument list have priority over mappings * from the maps passed earlier with the same keys. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap(Map, Map, * Map, int) newMutableMap(map1, map2, map3, expectedSize)}. * * @param map1 the first map to merge * @param map2 the second map to merge * @param map3 the third map to merge * @param expectedSize the expected size of the returned map * @param <K> the key type of the returned map * @return a new mutable map which merge the mappings of the specified maps */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap( @Nonnull Map<? extends K, Long> map1, @Nonnull Map<? extends K, Long> map2, @Nonnull Map<? extends K, Long> map3, int expectedSize) { return getDefaultFactory().<K>newMutableMap(map1, map2, map3, expectedSize); }
/** * Constructs a new mutable map which merge the mappings of the specified maps. On conflict, * mappings from the maps passed later in the argument list have priority over mappings * from the maps passed earlier with the same keys. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap(Map, Map, * Map, int) newMutableMap(map1, map2, map3, expectedSize)}. * * @param map1 the first map to merge * @param map2 the second map to merge * @param map3 the third map to merge * @param expectedSize the expected size of the returned map * @param <K> the key type of the returned map * @return a new mutable map which merge the mappings of the specified maps */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap( @Nonnull Map<? extends K, Long> map1, @Nonnull Map<? extends K, Long> map2, @Nonnull Map<? extends K, Long> map3, int expectedSize) { return getDefaultFactory().<K>newMutableMap(map1, map2, map3, expectedSize); }
/** * Constructs a new mutable map filled with mappings consumed by the callback within the given * closure. Mappings supplied later within the closure have priority over the mappings * passed earlier with the same keys. * * <p>Example: TODO * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap( * Consumer, int) newMutableMap(entriesSupplier, expectedSize)}. * * @param entriesSupplier the function which supply mappings for the returned map via * the callback passed in * @param expectedSize the expected size of the returned map * @param <K> the key type of the returned map * @return a new mutable map with mappings consumed by the callback within the given closure */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap(@Nonnull Consumer<com.koloboke.function.ObjLongConsumer<K>> entriesSupplier , int expectedSize) { return getDefaultFactory().<K>newMutableMap(entriesSupplier, expectedSize); }
/** * Constructs a new mutable map with the given mappings, i. e. pairs of elements from * the {@code keys} and {@code values} iterables at the same iteration position. If {@code keys} * have duplicate elements, value corresponding the key appeared last in the iteration is left * in the returned map. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap(Iterable, Iterable, int * ) newMutableMap(keys, values, expectedSize)}. * * @param keys the keys of the returned map * @param values the values of the returned map, each value is associated with the element * of the {@code keys} iterable at the same iteration position * @param expectedSize the expected size of the returned map * @param <K> the key type of the returned map * @return a new mutable map with the given mappings * @throws IllegalArgumentException if {@code keys} and {@code values} have different size */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap( @Nonnull Iterable<? extends K> keys, @Nonnull Iterable<Long> values , int expectedSize) { return getDefaultFactory().<K>newMutableMap(keys, values, expectedSize); }
/** * Constructs a new mutable map with the given mappings, i. e. pairs of elements from * the {@code keys} and {@code values} arrays at the same index. If {@code keys} array have * duplicate elements, value corresponding the key with the highest index is left * in the returned map. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjLongMapFactory#newMutableMap(Object[], long[] * ) newMutableMap(keys, values)}. * * @param keys the keys of the returned map * @param values the values of the returned map, each value is associated with the element * of the {@code keys} array at the same index * * @param <K> the key type of the returned map * @return a new mutable map with the given mappings * @throws IllegalArgumentException if {@code keys} and {@code values} arrays have different * length */ @Nonnull public static <K> HashObjLongMap<K> newMutableMap( @Nonnull K[] keys, @Nonnull long[] values) { return getDefaultFactory().<K>newMutableMap(keys, values); }