Example usage for java.util.concurrent ConcurrentHashMap ConcurrentHashMap

List of usage examples for java.util.concurrent ConcurrentHashMap ConcurrentHashMap

Introduction

In this page you can find the example usage for java.util.concurrent ConcurrentHashMap ConcurrentHashMap.

Prototype

public ConcurrentHashMap(int initialCapacity, float loadFactor, int concurrencyLevel) 

Source Link

Document

Creates a new, empty map with an initial table size based on the given number of elements ( initialCapacity ), initial table density ( loadFactor ), and number of concurrently updating threads ( concurrencyLevel ).

Usage

From source file:ConcurrentHashSet.java

/**
 * Constructs a new, empty set; the backing <tt>ConcurrentHashMap</tt> instance has the
 * specified initial capacity and the specified load factor.
 * //from w w  w  .  ja  v a2s .co  m
 * @param initialCapacity
 *            the initial capacity of the hash map.
 * @param loadFactor
 *            the load factor of the hash map.
 * @throws IllegalArgumentException
 *             if the initial capacity is less than zero, or if the load factor is nonpositive.
 */
public ConcurrentHashSet(int initialCapacity, float loadFactor) {
    map = new ConcurrentHashMap<E, Object>(initialCapacity, loadFactor, 16);
}

From source file:com.flowpowered.commons.datatable.SerializableHashMap.java

public SerializableHashMap(ClassResolver classProvider) {
    // Let's scale these values down a little
    // TODO: maybe tweak these a little
    this.map = new ConcurrentHashMap<>(8, .9f, 5);
    this.classProvider = classProvider;
}

From source file:jext2.DataStructureAccessProvider.java

protected DataStructureAccessProvider(int initialCapacity) {
    table = new ConcurrentHashMap<KEY, Data>(initialCapacity, 0.75f,
            (int) (Math.ceil(FuseJExt2.numberOfThreads * 1.5f)));
}

From source file:com.connectsdk.service.sessions.WebOSWebAppSession.java

public WebOSWebAppSession(LaunchSession launchSession, DeviceService service) {
    super(launchSession, service);

    UID = 0;/*  www.  j av a  2  s . co m*/
    mActiveCommands = new ConcurrentHashMap<String, ServiceCommand<?>>(0, 0.75f, 10);
    connected = false;

    this.service = (WebOSTVService) service;
}