private static <K, V> MapMakerInternalMap<K, V, ? extends InternalEntry<K, V, ?>, ? extends Segment<K, V, ?, ?>> makeMap(MapMaker maker) { return MapMakerInternalMap.create(maker); }
/** * Builds a thread-safe map. This method does not alter the state of this {@code MapMaker} * instance, so it can be invoked again to create multiple independent maps. * * <p>The bulk operations {@code putAll}, {@code equals}, and {@code clear} are not guaranteed to * be performed atomically on the returned map. Additionally, {@code size} and {@code * containsValue} are implemented as bulk read operations, and thus may fail to observe concurrent * writes. * * @return a serializable concurrent map having the requested features */ public <K, V> ConcurrentMap<K, V> makeMap() { if (!useCustomMap) { return new ConcurrentHashMap<>(getInitialCapacity(), 0.75f, getConcurrencyLevel()); } return MapMakerInternalMap.create(this); }
/** * Builds a thread-safe map. This method does not alter the state of this {@code MapMaker} * instance, so it can be invoked again to create multiple independent maps. * * <p>The bulk operations {@code putAll}, {@code equals}, and {@code clear} are not guaranteed to * be performed atomically on the returned map. Additionally, {@code size} and {@code * containsValue} are implemented as bulk read operations, and thus may fail to observe concurrent * writes. * * @return a serializable concurrent map having the requested features */ public <K, V> ConcurrentMap<K, V> makeMap() { if (!useCustomMap) { return new ConcurrentHashMap<>(getInitialCapacity(), 0.75f, getConcurrencyLevel()); } return MapMakerInternalMap.create(this); }
/** * Builds a thread-safe map. This method does not alter the state of this {@code MapMaker} * instance, so it can be invoked again to create multiple independent maps. * * <p>The bulk operations {@code putAll}, {@code equals}, and {@code clear} are not guaranteed to * be performed atomically on the returned map. Additionally, {@code size} and {@code * containsValue} are implemented as bulk read operations, and thus may fail to observe concurrent * writes. * * @return a serializable concurrent map having the requested features */ public <K, V> ConcurrentMap<K, V> makeMap() { if (!useCustomMap) { return new ConcurrentHashMap<>(getInitialCapacity(), 0.75f, getConcurrencyLevel()); } return MapMakerInternalMap.create(this); }
private static <K, V> MapMakerInternalMap<K, V, ? extends InternalEntry<K, V, ?>, ? extends Segment<K, V, ?, ?>> makeMap(MapMaker maker) { return MapMakerInternalMap.create(maker); }
/** * Builds a thread-safe map. This method does not alter the state of this {@code MapMaker} * instance, so it can be invoked again to create multiple independent maps. * * <p>The bulk operations {@code putAll}, {@code equals}, and {@code clear} are not guaranteed to * be performed atomically on the returned map. Additionally, {@code size} and {@code * containsValue} are implemented as bulk read operations, and thus may fail to observe concurrent * writes. * * @return a serializable concurrent map having the requested features */ public <K, V> ConcurrentMap<K, V> makeMap() { if (!useCustomMap) { return new ConcurrentHashMap<>(getInitialCapacity(), 0.75f, getConcurrencyLevel()); } return MapMakerInternalMap.create(this); }
/** * Builds a thread-safe map. This method does not alter the state of this {@code MapMaker} * instance, so it can be invoked again to create multiple independent maps. * * <p>The bulk operations {@code putAll}, {@code equals}, and {@code clear} are not guaranteed to * be performed atomically on the returned map. Additionally, {@code size} and {@code * containsValue} are implemented as bulk read operations, and thus may fail to observe concurrent * writes. * * @return a serializable concurrent map having the requested features */ public <K, V> ConcurrentMap<K, V> makeMap() { if (!useCustomMap) { return new ConcurrentHashMap<>(getInitialCapacity(), 0.75f, getConcurrencyLevel()); } return MapMakerInternalMap.create(this); }