/** * Constructs a new empty mutable map of the default expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashIntObjMapFactory#newMutableMap() newMutableMap()}. * * @param <V> the value type of the returned map * @return a new empty mutable map */ @Nonnull public static <V> HashIntObjMap<V> newMutableMap() { return getDefaultFactory().<V>newMutableMap(); }
/** * Constructs a new immutable map with the same mappings as the specified {@code map}. * * * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashIntObjMapFactory#newImmutableMap( * Map) newImmutableMap(map)}. * * @param map the map whose mappings are to be placed in the returned map * * @param <V> the value type of the returned map * @return a new immutable map with the same mappings as the specified {@code map} */ @Nonnull public static <V> HashIntObjMap<V> newImmutableMap( @Nonnull Map<Integer, ? extends V> map) { return getDefaultFactory().<V>newImmutableMap(map); }
/** * Constructs a new immutable map of the single specified mapping. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashIntObjMapFactory#newImmutableMapOf(int, Object * ) newImmutableMapOf(k1, v1)}. * * @param k1 the key of the sole mapping * @param v1 the value of the sole mapping * @param <V> the value type of the returned map * @return a new immutable map of the single specified mapping */ @Nonnull public static <V> HashIntObjMap<V> newImmutableMapOf( int k1, V v1) { return getDefaultFactory().<V>newImmutableMapOf(k1, v1); }
private static <T> HashIntObjMap<T> makeMap(final int size, final float fillFactor ) { return HashIntObjMaps.getDefaultFactory().withHashConfig(HashConfig.fromLoads( fillFactor/2, fillFactor, fillFactor)).newMutableMap( size ); }
/** * Constructs a new empty updatable map of the default expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashIntObjMapFactory#newUpdatableMap() newUpdatableMap()}. * * @param <V> the value type of the returned map * @return a new empty updatable map */ @Nonnull public static <V> HashIntObjMap<V> newUpdatableMap() { return getDefaultFactory().<V>newUpdatableMap(); }
/** * Constructs a new mutable map of the single specified mapping. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashIntObjMapFactory#newMutableMapOf(int, Object * ) newMutableMapOf(k1, v1)}. * * @param k1 the key of the sole mapping * @param v1 the value of the sole mapping * @param <V> the value type of the returned map * @return a new mutable map of the single specified mapping */ @Nonnull public static <V> HashIntObjMap<V> newMutableMapOf( int k1, V v1) { return getDefaultFactory().<V>newMutableMapOf(k1, v1); }
/** * Constructs a new updatable map of the single specified mapping. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashIntObjMapFactory#newUpdatableMapOf(int, Object * ) newUpdatableMapOf(k1, v1)}. * * @param k1 the key of the sole mapping * @param v1 the value of the sole mapping * @param <V> the value type of the returned map * @return a new updatable map of the single specified mapping */ @Nonnull public static <V> HashIntObjMap<V> newUpdatableMapOf( int k1, V v1) { return getDefaultFactory().<V>newUpdatableMapOf(k1, v1); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj instanceof HashIntObjMapFactory) { HashIntObjMapFactory factory = (HashIntObjMapFactory) obj; return commonEquals(factory) && keySpecialEquals(factory) && getValueEquivalence().equals(factory.getValueEquivalence()) ; } else { return false; } }
/** * Constructs a new empty updatable map of the default expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashIntObjMapFactory#newUpdatableMap() newUpdatableMap()}. * * @param <V> the value type of the returned map * @return a new empty updatable map */ @Nonnull public static <V> HashIntObjMap<V> newUpdatableMap() { return getDefaultFactory().<V>newUpdatableMap(); }
/** * Constructs a new mutable map of the single specified mapping. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashIntObjMapFactory#newMutableMapOf(int, Object * ) newMutableMapOf(k1, v1)}. * * @param k1 the key of the sole mapping * @param v1 the value of the sole mapping * @param <V> the value type of the returned map * @return a new mutable map of the single specified mapping */ @Nonnull public static <V> HashIntObjMap<V> newMutableMapOf( int k1, V v1) { return getDefaultFactory().<V>newMutableMapOf(k1, v1); }
/** * Constructs a new updatable map of the single specified mapping. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashIntObjMapFactory#newUpdatableMapOf(int, Object * ) newUpdatableMapOf(k1, v1)}. * * @param k1 the key of the sole mapping * @param v1 the value of the sole mapping * @param <V> the value type of the returned map * @return a new updatable map of the single specified mapping */ @Nonnull public static <V> HashIntObjMap<V> newUpdatableMapOf( int k1, V v1) { return getDefaultFactory().<V>newUpdatableMapOf(k1, v1); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj instanceof HashIntObjMapFactory) { HashIntObjMapFactory factory = (HashIntObjMapFactory) obj; return commonEquals(factory) && keySpecialEquals(factory) && getValueEquivalence().equals(factory.getValueEquivalence()) ; } else { return false; } }
/** * Constructs a new empty mutable map of the given expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashIntObjMapFactory#newMutableMap(int) newMutableMap(expectedSize)}. * * @param expectedSize the expected size of the returned map * @param <V> the value type of the returned map * @return a new empty mutable map of the given expected size */ @Nonnull public static <V> HashIntObjMap<V> newMutableMap(int expectedSize) { return getDefaultFactory().<V>newMutableMap(expectedSize); }
/** * Constructs a new empty updatable map of the given expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashIntObjMapFactory#newUpdatableMap(int) newUpdatableMap(expectedSize)}. * * @param expectedSize the expected size of the returned map * @param <V> the value type of the returned map * @return a new empty updatable map of the given expected size */ @Nonnull public static <V> HashIntObjMap<V> newUpdatableMap(int expectedSize) { return getDefaultFactory().<V>newUpdatableMap(expectedSize); }
/** * Constructs a new immutable 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 HashIntObjMapFactory#newImmutableMap(Map, * Map) newImmutableMap(map1, map2)}. * * @param map1 the first map to merge * @param map2 the second map to merge * * @param <V> the value type of the returned map * @return a new immutable map which merge the mappings of the specified maps */ @Nonnull public static <V> HashIntObjMap<V> newImmutableMap( @Nonnull Map<Integer, ? extends V> map1, @Nonnull Map<Integer, ? extends V> map2) { return getDefaultFactory().<V>newImmutableMap(map1, map2); }
/** * Constructs a new mutable map of the two specified mappings. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashIntObjMapFactory#newMutableMapOf(int, Object, * int, Object) newMutableMapOf(k1, v1, k2, v2)}. * * @param k1 the key of the first mapping * @param v1 the value of the first mapping * @param k2 the key of the second mapping * @param v2 the value of the second mapping * @param <V> the value type of the returned map * @return a new mutable map of the two specified mappings */ @Nonnull public static <V> HashIntObjMap<V> newMutableMapOf( int k1, V v1, int k2, V v2) { return getDefaultFactory().<V>newMutableMapOf(k1, v1, k2, v2); }
/** * Constructs a new immutable map of the single specified mapping. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashIntObjMapFactory#newImmutableMapOf(int, Object * ) newImmutableMapOf(k1, v1)}. * * @param k1 the key of the sole mapping * @param v1 the value of the sole mapping * @param <V> the value type of the returned map * @return a new immutable map of the single specified mapping */ @Nonnull public static <V> HashIntObjMap<V> newImmutableMapOf( int k1, V v1) { return getDefaultFactory().<V>newImmutableMapOf(k1, v1); }
/** * Constructs a new updatable map of the two specified mappings. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashIntObjMapFactory#newUpdatableMapOf(int, Object, * int, Object) newUpdatableMapOf(k1, v1, k2, v2)}. * * @param k1 the key of the first mapping * @param v1 the value of the first mapping * @param k2 the key of the second mapping * @param v2 the value of the second mapping * @param <V> the value type of the returned map * @return a new updatable map of the two specified mappings */ @Nonnull public static <V> HashIntObjMap<V> newUpdatableMapOf( int k1, V v1, int k2, V v2) { return getDefaultFactory().<V>newUpdatableMapOf(k1, v1, k2, v2); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj instanceof HashIntObjMapFactory) { HashIntObjMapFactory factory = (HashIntObjMapFactory) obj; return commonEquals(factory) && keySpecialEquals(factory) && getValueEquivalence().equals(factory.getValueEquivalence()) ; } else { return false; } }
/** * Constructs a new empty mutable map of the default expected size. * * <p>This method simply delegates to {@link #getDefaultFactory() * }<tt>.</tt>{@link HashIntObjMapFactory#newMutableMap() newMutableMap()}. * * @param <V> the value type of the returned map * @return a new empty mutable map */ @Nonnull public static <V> HashIntObjMap<V> newMutableMap() { return getDefaultFactory().<V>newMutableMap(); }