Class TLcdHashMap<K,V>

java.lang.Object
com.luciad.util.collections.TLcdHashMap<K,V>
All Implemented Interfaces:
ILcdMap<K,V>, Cloneable, Map<K,V>

public class TLcdHashMap<K,V> extends Object implements ILcdMap<K,V>, Cloneable
An implementation of ILcdMap that behaves similar to HashMap.
Since:
10.0
  • Constructor Details

    • TLcdHashMap

      public TLcdHashMap()
      Constructs an empty map with an initial capacity of ten.
    • TLcdHashMap

      public TLcdHashMap(int aInitialCapacity)
      Constructs an empty map with the specified initial capacity.
      Parameters:
      aInitialCapacity - the initial capacity of the map
      Throws:
      IllegalArgumentException - if the specified initical capacity is negative
  • Method Details

    • put

      public V put(K aKey, V aValue)
      Specified by:
      put in interface Map<K,V>
    • putAll

      public void putAll(Map<? extends K,? extends V> aMap)
      Specified by:
      putAll in interface Map<K,V>
    • remove

      public V remove(Object aKey)
      Specified by:
      remove in interface Map<K,V>
    • clear

      public void clear()
      Specified by:
      clear in interface Map<K,V>
    • containsKey

      public boolean containsKey(Object aKey)
      Specified by:
      containsKey in interface Map<K,V>
    • containsValue

      public boolean containsValue(Object aValue)
      Specified by:
      containsValue in interface Map<K,V>
    • entrySet

      public Set<Map.Entry<K,V>> entrySet()
      Specified by:
      entrySet in interface Map<K,V>
    • equals

      public boolean equals(Object aObject)
      Specified by:
      equals in interface Map<K,V>
      Overrides:
      equals in class Object
    • get

      public V get(Object aKey)
      Specified by:
      get in interface Map<K,V>
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Map<K,V>
      Overrides:
      hashCode in class Object
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map<K,V>
    • keySet

      public Set<K> keySet()
      Specified by:
      keySet in interface Map<K,V>
    • size

      public int size()
      Specified by:
      size in interface Map<K,V>
    • values

      public Collection<V> values()
      Specified by:
      values in interface Map<K,V>
    • addMapListener

      public void addMapListener(ILcdMapListener<K,V> aMapListener)
      Description copied from interface: ILcdMap

      Register the listener aMapListener to be informed about changes in this map.

      Specified by:
      addMapListener in interface ILcdMap<K,V>
      Parameters:
      aMapListener - the listener
      See Also:
    • removeMapListener

      public void removeMapListener(ILcdMapListener<K,V> aMapListener)
      Description copied from interface: ILcdMap

      Unregister the listener aMapListener so it will no longer be informed about changes in this map.

      This method should do nothing when addMapListener was not registered previously.

      Specified by:
      removeMapListener in interface ILcdMap<K,V>
      Parameters:
      aMapListener - the listener
      See Also:
    • clone

      public Object clone()
      Returns a shallow copy of this TLcdHashMap instance. (The keys and values themselves are not cloned.). The returned Map will have no listeners attached to it.
      Overrides:
      clone in class Object
      Returns:
      a clone of this TLcdHashMap instance