Class ConcurrentHashMapNullSafe<K,V>

java.lang.Object
com.cedarsoftware.util.AbstractConcurrentNullSafeMap<K,V>
com.cedarsoftware.util.ConcurrentHashMapNullSafe<K,V>
Type Parameters:
K - The type of keys maintained by this map
V - The type of mapped values
All Implemented Interfaces:
ConcurrentMap<K,V>, Map<K,V>

public class ConcurrentHashMapNullSafe<K,V> extends AbstractConcurrentNullSafeMap<K,V>
ConcurrentHashMapNullSafe is a thread-safe implementation of ConcurrentMap that allows null keys and null values by using sentinel objects internally.
Author:
John DeRegnaucourt ([email protected])
Copyright (c) Cedar Software LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

License

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
  • Constructor Details

    • ConcurrentHashMapNullSafe

      public ConcurrentHashMapNullSafe()
      Constructs a new, empty ConcurrentHashMapNullSafe with default initial capacity (16) and load factor (0.75).
    • ConcurrentHashMapNullSafe

      public ConcurrentHashMapNullSafe(int initialCapacity)
      Constructs a new, empty ConcurrentHashMapNullSafe with the specified initial capacity and default load factor (0.75).
      Parameters:
      initialCapacity - the initial capacity. The implementation performs internal sizing to accommodate this many elements.
      Throws:
      IllegalArgumentException - if the initial capacity is negative.
    • ConcurrentHashMapNullSafe

      public ConcurrentHashMapNullSafe(int initialCapacity, float loadFactor)
      Constructs a new, empty ConcurrentHashMapNullSafe with the specified initial capacity and load factor.
      Parameters:
      initialCapacity - the initial capacity. The implementation performs internal sizing to accommodate this many elements.
      loadFactor - the load factor threshold, used to control resizing. Resizing may be performed when the average number of elements per bin exceeds this threshold.
      Throws:
      IllegalArgumentException - if the initial capacity is negative or the load factor is nonpositive
    • ConcurrentHashMapNullSafe

      public ConcurrentHashMapNullSafe(Map<? extends K,? extends V> m)
      Constructs a new ConcurrentHashMapNullSafe with the same mappings as the specified map.
      Parameters:
      m - the map whose mappings are to be placed in this map
      Throws:
      NullPointerException - if the specified map is null