/** * Creates a new {@link Set} backed by a ConcurrentHashMapV8 * from the given type to {@code Boolean.TRUE}. * * @return the new set * @since 1.8 */ public static <K> KeySetView<K, Boolean> newKeySet() { return new KeySetView<K, Boolean> (new ConcurrentHashMapV8<K, Boolean>(), Boolean.TRUE); }
/** * Creates a new {@link Set} backed by a ConcurrentHashMapV8 * from the given type to {@code Boolean.TRUE}. * * @return the new set * @since 1.8 */ public static <K> KeySetView<K, Boolean> newKeySet() { return new KeySetView<K, Boolean> (new ConcurrentHashMapV8<K, Boolean>(), Boolean.TRUE); }
/** * Creates a new {@link Set} backed by a ConcurrentHashMapV8 * from the given type to {@code Boolean.TRUE}. * * @param initialCapacity The implementation performs internal * sizing to accommodate this many elements. * @return the new set * @throws IllegalArgumentException if the initial capacity of * elements is negative * @since 1.8 */ public static <K> KeySetView<K, Boolean> newKeySet(final int initialCapacity) { return new KeySetView<K, Boolean> (new ConcurrentHashMapV8<K, Boolean>(initialCapacity), Boolean.TRUE); }
/** * Creates a new {@link Set} backed by a ConcurrentHashMapV8 * from the given type to {@code Boolean.TRUE}. * * @param initialCapacity The implementation performs internal * sizing to accommodate this many elements. * @return the new set * @throws IllegalArgumentException if the initial capacity of * elements is negative * @since 1.8 */ public static <K> KeySetView<K, Boolean> newKeySet(final int initialCapacity) { return new KeySetView<K, Boolean> (new ConcurrentHashMapV8<K, Boolean>(initialCapacity), Boolean.TRUE); }
/** * Creates a new, empty map with a default initial capacity (16), * load factor (0.75) and concurrencyLevel (16). * <p> * On Oracle JDK, the factory method will return an instance of * <a href="http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166edocs/jsr166e/ConcurrentHashMapV8.html"> * {@code ConcurrentHashMapV8}</a> * that is supposed to be available in JDK 8 and provides better performance and memory characteristics than * {@link ConcurrentHashMap} implementation from JDK 7 or earlier. On non-Oracle JDK, * the factory instantiates the standard {@code ConcurrentHashMap} from JDK. * </p> * * @return the map. */ public static <K, V> ConcurrentMap<K, V> createConcurrentMap() { return JdkVersion.getJdkVersion().isUnsafeSupported() ? new ConcurrentHashMapV8<K, V>() : new ConcurrentHashMap<K, V>(); }
/** * Creates a new map with the same mappings as the given map. * <p> * On Oracle JDK, the factory method will return an instance of * <a href="http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166edocs/jsr166e/ConcurrentHashMapV8.html"> * {@code ConcurrentHashMapV8}</a> * that is supposed to be available in JDK 8 and provides better performance and memory characteristics than * {@link ConcurrentHashMap} implementation from JDK 7 or earlier. On non-Oracle JDK, * the factory instantiates the standard {@code ConcurrentHashMap} from JDK. * </p> * * @param map the map. */ public static <K, V> ConcurrentMap<K, V> createConcurrentMap( final Map<? extends K, ? extends V> map) { return JdkVersion.getJdkVersion().isUnsafeSupported() ? new ConcurrentHashMapV8<K, V>(map) : new ConcurrentHashMap<K, V>(map); }
/** * Creates a new, empty map with a default initial capacity (16), * load factor (0.75) and concurrencyLevel (16). * <p> * On Oracle JDK, the factory method will return an instance of * <a href="http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166edocs/jsr166e/ConcurrentHashMapV8.html"> * {@code ConcurrentHashMapV8}</a> * that is supposed to be available in JDK 8 and provides better performance and memory characteristics than * {@link ConcurrentHashMap} implementation from JDK 7 or earlier. On non-Oracle JDK, * the factory instantiates the standard {@code ConcurrentHashMap} from JDK. * </p> * * @return the map. */ public static <K, V> ConcurrentMap<K, V> createConcurrentMap() { return JdkVersion.getJdkVersion().isUnsafeSupported() ? new ConcurrentHashMapV8<K, V>() : new ConcurrentHashMap<K, V>(); }
/** * Creates a new map with the same mappings as the given map. * <p> * On Oracle JDK, the factory method will return an instance of * <a href="http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166edocs/jsr166e/ConcurrentHashMapV8.html"> * {@code ConcurrentHashMapV8}</a> * that is supposed to be available in JDK 8 and provides better performance and memory characteristics than * {@link ConcurrentHashMap} implementation from JDK 7 or earlier. On non-Oracle JDK, * the factory instantiates the standard {@code ConcurrentHashMap} from JDK. * </p> * * @param map the map. */ public static <K, V> ConcurrentMap<K, V> createConcurrentMap( final Map<? extends K, ? extends V> map) { return JdkVersion.getJdkVersion().isUnsafeSupported() ? new ConcurrentHashMapV8<K, V>(map) : new ConcurrentHashMap<K, V>(map); }
/** * Creates a new, empty map with an initial table size accommodating the specified * number of elements without the need to dynamically resize. * <p> * On Oracle JDK, the factory method will return an instance of * <a href="http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166edocs/jsr166e/ConcurrentHashMapV8.html"> * {@code ConcurrentHashMapV8}</a> * that is supposed to be available in JDK 8 and provides better performance and memory characteristics than * {@link ConcurrentHashMap} implementation from JDK 7 or earlier. On non-Oracle JDK, * the factory instantiates the standard {@code ConcurrentHashMap} from JDK. * </p> * * @param initialCapacity The implementation performs internal * sizing to accommodate this many elements. * @throws IllegalArgumentException if the initial capacity of * elements is negative. */ public static <K, V> ConcurrentMap<K, V> createConcurrentMap( final int initialCapacity) { return JdkVersion.getJdkVersion().isUnsafeSupported() ? new ConcurrentHashMapV8<K, V>(initialCapacity) : new ConcurrentHashMap<K, V>(initialCapacity); }
/** * Creates a new, empty map with an initial table size accommodating the specified * number of elements without the need to dynamically resize. * <p> * On Oracle JDK, the factory method will return an instance of * <a href="http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166edocs/jsr166e/ConcurrentHashMapV8.html"> * {@code ConcurrentHashMapV8}</a> * that is supposed to be available in JDK 8 and provides better performance and memory characteristics than * {@link ConcurrentHashMap} implementation from JDK 7 or earlier. On non-Oracle JDK, * the factory instantiates the standard {@code ConcurrentHashMap} from JDK. * </p> * * @param initialCapacity The implementation performs internal * sizing to accommodate this many elements. * @throws IllegalArgumentException if the initial capacity of * elements is negative. */ public static <K, V> ConcurrentMap<K, V> createConcurrentMap( final int initialCapacity) { return JdkVersion.getJdkVersion().isUnsafeSupported() ? new ConcurrentHashMapV8<K, V>(initialCapacity) : new ConcurrentHashMap<K, V>(initialCapacity); }
final int concurrencyLevel) { return JdkVersion.getJdkVersion().isUnsafeSupported() ? new ConcurrentHashMapV8<K, V>(initialCapacity, loadFactor, concurrencyLevel) : new ConcurrentHashMap<K, V>(initialCapacity, loadFactor, concurrencyLevel);
final int concurrencyLevel) { return JdkVersion.getJdkVersion().isUnsafeSupported() ? new ConcurrentHashMapV8<K, V>(initialCapacity, loadFactor, concurrencyLevel) : new ConcurrentHashMap<K, V>(initialCapacity, loadFactor, concurrencyLevel);
/** * Creates a new {@link Set} backed by a ConcurrentHashMapV8 * from the given type to {@code Boolean.TRUE}. * * @return the new set * @since 1.8 */ public static <K> KeySetView<K, Boolean> newKeySet() { return new KeySetView<K, Boolean> (new ConcurrentHashMapV8<K, Boolean>(), Boolean.TRUE); }
/** * Creates a new {@link Set} backed by a ConcurrentHashMapV8 * from the given type to {@code Boolean.TRUE}. * * @return the new set * @since 1.8 */ public static <K> KeySetView<K, Boolean> newKeySet() { return new KeySetView<K, Boolean> (new ConcurrentHashMapV8<K, Boolean>(), Boolean.TRUE); }
/** * Creates a new {@link Set} backed by a ConcurrentHashMapV8 * from the given type to {@code Boolean.TRUE}. * * @return the new set * @since 1.8 */ public static <K> KeySetView<K, Boolean> newKeySet() { return new KeySetView<K, Boolean> (new ConcurrentHashMapV8<K, Boolean>(), Boolean.TRUE); }
/** * Creates a new {@link Set} backed by a ConcurrentHashMapV8 * from the given type to {@code Boolean.TRUE}. * * @return the new set * @since 1.8 */ public static <K> KeySetView<K, Boolean> newKeySet() { return new KeySetView<K, Boolean> (new ConcurrentHashMapV8<K, Boolean>(), Boolean.TRUE); }
/** * Creates a new {@link Set} backed by a ConcurrentHashMapV8 * from the given type to {@code Boolean.TRUE}. * * @return the new set * @since 1.8 */ public static <K> KeySetView<K, Boolean> newKeySet() { return new KeySetView<K, Boolean> (new ConcurrentHashMapV8<K, Boolean>(), Boolean.TRUE); }
/** * Creates a new {@link Set} backed by a ConcurrentHashMapV8 * from the given type to {@code Boolean.TRUE}. * * @param initialCapacity The implementation performs internal * sizing to accommodate this many elements. * @return the new set * @throws IllegalArgumentException if the initial capacity of * elements is negative * @since 1.8 */ public static <K> KeySetView<K, Boolean> newKeySet(final int initialCapacity) { return new KeySetView<K, Boolean> (new ConcurrentHashMapV8<K, Boolean>(initialCapacity), Boolean.TRUE); }
/** * Creates a new {@link Set} backed by a ConcurrentHashMapV8 * from the given type to {@code Boolean.TRUE}. * * @param initialCapacity The implementation performs internal * sizing to accommodate this many elements. * @return the new set * @throws IllegalArgumentException if the initial capacity of * elements is negative * @since 1.8 */ public static <K> KeySetView<K, Boolean> newKeySet(final int initialCapacity) { return new KeySetView<K, Boolean> (new ConcurrentHashMapV8<K, Boolean>(initialCapacity), Boolean.TRUE); }
/** * Creates a new {@link Set} backed by a ConcurrentHashMapV8 * from the given type to {@code Boolean.TRUE}. * * @param initialCapacity The implementation performs internal * sizing to accommodate this many elements. * @return the new set * @throws IllegalArgumentException if the initial capacity of * elements is negative * @since 1.8 */ public static <K> KeySetView<K, Boolean> newKeySet(final int initialCapacity) { return new KeySetView<K, Boolean> (new ConcurrentHashMapV8<K, Boolean>(initialCapacity), Boolean.TRUE); }