Class CaseBlindHashMap

  • All Implemented Interfaces:
    Serializable, Cloneable, Map

    public class CaseBlindHashMap
    extends HashMap
    CaseBlindHashMap - a HashMap extension, using Strings as key values.

    Internally, keys are case insensitive: ABC = abc.

    Two methods have been added to facilitate working with Sets of key strings. See stringKeySet() and stringKeyIterator().

    See Also:
    Serialized Form
    • Constructor Detail

      • CaseBlindHashMap

        public CaseBlindHashMap()
        Constructors
      • CaseBlindHashMap

        public CaseBlindHashMap​(int initCap)
      • CaseBlindHashMap

        public CaseBlindHashMap​(int initCap,
                                float loadFactor)
    • Method Detail

      • stringKeySet

        public Set stringKeySet()
        Get the set of keys contained in this map. Keys values are returned as simple Strings (not the CaseBlindStrings used internally).

        This is accopmlished by making a copy of the original map - modifications made to this copy are not reflected in the original.

        Returns:
        The set of keys
      • stringKeyIterator

        public Iterator stringKeyIterator()
        Get an Iterator to the String based key set
        Returns:
        An iterator to the key set
      • containsKey

        public boolean containsKey​(String key)
        Does the map contain this key?
        Parameters:
        key - The key to look up
        Returns:
        true If the key is present in the map
      • get

        public Object get​(String key)
        Fetch a value by name - null keys are not supported
        Parameters:
        key - The key to look up
        Returns:
        The associated value object
      • put

        public void put​(String key,
                        Object value)
        Add the key/value pair to the map - null values are not supported
        Parameters:
        key - The key name
        value - The object to store
      • remove

        public void remove​(String key)
        Remove a key/value pair from this map
        Parameters:
        key - Non-null key to remove