/** * Constructs a new empty mutable map of the default expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashObjIntMapFactory#newMutableMap() newMutableMap()}. * * @param <K> the key type of the returned map * @return a new empty mutable map */ @Nonnull public static <K> HashObjIntMap<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 HashObjIntMapFactory#newMutableMap() newMutableMap()}. * * @param <K> the key type of the returned map * @return a new empty mutable map */ @Nonnull public static <K> HashObjIntMap<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 HashObjIntMapFactory#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> HashObjIntMap<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 HashObjIntMapFactory#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> HashObjIntMap<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 HashObjIntMapFactory#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> HashObjIntMap<K> newMutableMap( @Nonnull Map<? extends K, Integer> map) { return getDefaultFactory().<K>newMutableMap(map); }
/** * 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 HashObjIntMapFactory#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> HashObjIntMap<K> newMutableMap( @Nonnull Map<? extends K, Integer> 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 HashObjIntMapFactory#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> HashObjIntMap<K> newMutableMap( @Nonnull Map<? extends K, Integer> map1, @Nonnull Map<? extends K, Integer> 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 HashObjIntMapFactory#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> HashObjIntMap<K> newMutableMap( @Nonnull Map<? extends K, Integer> map1, @Nonnull Map<? extends K, Integer> 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 HashObjIntMapFactory#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> HashObjIntMap<K> newMutableMap( @Nonnull Map<? extends K, Integer> map1, @Nonnull Map<? extends K, Integer> 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 HashObjIntMapFactory#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> HashObjIntMap<K> newMutableMap( @Nonnull Map<? extends K, Integer> map1, @Nonnull Map<? extends K, Integer> 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>If the specified map is an instance of {@code ObjIntMap} and has the same * {@linkplain ObjIntMap#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 HashObjIntMapFactory#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> HashObjIntMap<K> newMutableMap( @Nonnull Map<? extends K, Integer> 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 HashObjIntMapFactory#newMutableMap(Map, Map, * Map) newMutableMap(map1, map2, map3)}. * * @param map1 the first map to merge * @param map2 the second map to merge * @param map3 the third 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> HashObjIntMap<K> newMutableMap( @Nonnull Map<? extends K, Integer> map1, @Nonnull Map<? extends K, Integer> map2, @Nonnull Map<? extends K, Integer> map3) { return getDefaultFactory().<K>newMutableMap(map1, map2, map3); }
/** * 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 HashObjIntMapFactory#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> HashObjIntMap<K> newMutableMap( @Nonnull Map<? extends K, Integer> map1, @Nonnull Map<? extends K, Integer> map2, @Nonnull Map<? extends K, Integer> 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 HashObjIntMapFactory#newMutableMap(Map, Map, * Map) newMutableMap(map1, map2, map3)}. * * @param map1 the first map to merge * @param map2 the second map to merge * @param map3 the third 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> HashObjIntMap<K> newMutableMap( @Nonnull Map<? extends K, Integer> map1, @Nonnull Map<? extends K, Integer> map2, @Nonnull Map<? extends K, Integer> map3) { return getDefaultFactory().<K>newMutableMap(map1, map2, map3); }
/** * 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 HashObjIntMapFactory#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> HashObjIntMap<K> newMutableMap(@Nonnull Consumer<com.koloboke.function.ObjIntConsumer<K>> entriesSupplier ) { return getDefaultFactory().<K>newMutableMap(entriesSupplier); }
/** * 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 HashObjIntMapFactory#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> HashObjIntMap<K> newMutableMap(@Nonnull Consumer<com.koloboke.function.ObjIntConsumer<K>> entriesSupplier , int expectedSize) { return getDefaultFactory().<K>newMutableMap(entriesSupplier, 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 HashObjIntMapFactory#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> HashObjIntMap<K> newMutableMap(@Nonnull Consumer<com.koloboke.function.ObjIntConsumer<K>> entriesSupplier , int expectedSize) { return getDefaultFactory().<K>newMutableMap(entriesSupplier, expectedSize); }
/** * Constructs a new mutable map with the same mappings as the specified {@code map}. * * * <p>If the specified map is an instance of {@code ObjIntMap} and has the same * {@linkplain ObjIntMap#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 HashObjIntMapFactory#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> HashObjIntMap<K> newMutableMap( @Nonnull Map<? extends K, Integer> map, int expectedSize) { return getDefaultFactory().<K>newMutableMap(map, 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 HashObjIntMapFactory#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> HashObjIntMap<K> newMutableMap(@Nonnull Consumer<com.koloboke.function.ObjIntConsumer<K>> entriesSupplier ) { return getDefaultFactory().<K>newMutableMap(entriesSupplier); }
private static <T> HashObjIntMap<T> makeMap(final int size, final float fillFactor ) { return HashObjIntMaps.getDefaultFactory().withHashConfig(HashConfig.fromLoads( fillFactor/2, fillFactor, fillFactor )). newMutableMap(size); }