Class TLcdMapEvent<K,V>

java.lang.Object
java.util.EventObject
com.luciad.util.collections.TLcdMapEvent<K,V>
All Implemented Interfaces:
Serializable

public class TLcdMapEvent<K,V> extends EventObject
An event describing a change in an ILcdMap.
Since:
10.0
See Also:
  • Constructor Details

    • TLcdMapEvent

      public TLcdMapEvent(ILcdMap<K,V> aMap, TLcdMapEvent.Type aType, K aKey, V aValue, boolean aIsAdjusting)
      Create a new event describing a change in the map aMap.
      Parameters:
      aMap - The map in which the change occurred.
      aType - The type describing the nature of the change.
      aKey - The map key which caused the change.
      aValue - The map value which caused the change.
      aIsAdjusting - true if more changes will be made to the map after this change, false otherwise
  • Method Details

    • getType

      public TLcdMapEvent.Type getType()
      Returns the type describing the nature of the change.
      Returns:
      the type describing the nature of the change.
    • getSource

      public ILcdMap<K,V> getSource()
      Overrides:
      getSource in class EventObject
    • getKey

      public K getKey()

      Returns the key of the entry which caused the change in the map:

      • Type == ELEMENT_ADDED: the returned object is the key of the entry that was added to the map.
      • Type == ELEMENT_REMOVED: the returned object is the key of the entry that was removed from the map.
      Returns:
      the key of the entry which caused the change in the map.
    • getValue

      public V getValue()

      Returns the value of the entry which caused the change in the map:

      • Type == ELEMENT_ADDED: the returned object is the value of the entry that was added to the map.
      • Type == ELEMENT_REMOVED: the returned object is the value of the entry that was removed from the map.
      Returns:
      the value of the entry which caused the change in the map.
    • isAdjusting

      public boolean isAdjusting()

      Returns true if more changes will be made to the map immediately after this one, false otherwise.

      When for example using Map.putAll(java.util.Map) events will be fired for every entry added to the map. In this case this property should be true for all events except the one of the last inserted entry.

      Returns:
      true if more changes will be made to the map immediately after this one, false otherwise.