Class ConcurrentLinkedHashMap.Builder<K,​V>

  • Enclosing class:

    public static final class ConcurrentLinkedHashMap.Builder<K,​V>
    extends Object
    A builder that creates ConcurrentLinkedHashMap instances. It provides a flexible approach for constructing customized instances with a named parameter syntax. It can be used in the following manner:
     ConcurrentMap<Vertex, Set<Edge>> graph = new Builder<Vertex, Set<Edge>>()
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • initialCapacity

        public ConcurrentLinkedHashMap.Builder<K,​V> initialCapacity​(int initialCapacity)
        Specifies the initial capacity of the hash table (default 16). This is the number of key-value pairs that the hash table can hold before a resize operation is required.
        initialCapacity - the initial capacity used to size the hash table to accommodate this many entries.
        IllegalArgumentException - if the initialCapacity is negative
      • maximumWeightedCapacity

        public ConcurrentLinkedHashMap.Builder<K,​V> maximumWeightedCapacity​(long capacity)
        Specifies the maximum weighted capacity to coerce the map to and may exceed it temporarily.
        capacity - the weighted threshold to bound the map by
        IllegalArgumentException - if the maximumWeightedCapacity is negative
      • concurrencyLevel

        public ConcurrentLinkedHashMap.Builder<K,​V> concurrencyLevel​(int concurrencyLevel)
        Specifies the estimated number of concurrently updating threads. The implementation performs internal sizing to try to accommodate this many threads (default 16).
        concurrencyLevel - the estimated number of concurrently updating threads
        IllegalArgumentException - if the concurrencyLevel is less than or equal to zero