Class MapWrapper<T,E>

java.lang.Object
jadex.collection.MapWrapper<T,E>
All Implemented Interfaces:
Map<T,E>

public abstract class MapWrapper<T,E> extends Object implements Map<T,E>
Wrap a map and call template methods on modification.
  • Field Details

    • delegate

      protected Map<T,E> delegate
      The delegate map.
  • Constructor Details

    • MapWrapper

      public MapWrapper(Map<T,E> delegate)
      Create a new collection wrapper.
  • Method Details

    • size

      public int size()
      Specified by:
      size in interface Map<T,E>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map<T,E>
    • containsKey

      public boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map<T,E>
    • containsValue

      public boolean containsValue(Object value)
      Specified by:
      containsValue in interface Map<T,E>
    • get

      public E get(Object key)
      Specified by:
      get in interface Map<T,E>
    • put

      public E put(T key, E value)
      Specified by:
      put in interface Map<T,E>
    • remove

      public E remove(Object key)
      Specified by:
      remove in interface Map<T,E>
    • putAll

      public void putAll(Map<? extends T,? extends E> m)
      Specified by:
      putAll in interface Map<T,E>
    • clear

      public void clear()
      Specified by:
      clear in interface Map<T,E>
    • keySet

      public Set<T> keySet()
      Specified by:
      keySet in interface Map<T,E>
    • values

      public Collection<E> values()
      Specified by:
      values in interface Map<T,E>
    • entrySet

      public Set<Map.Entry<T,E>> entrySet()
      Specified by:
      entrySet in interface Map<T,E>
    • hashCode

      public int hashCode()
      Get the hashcode of the object.
      Specified by:
      hashCode in interface Map<T,E>
      Overrides:
      hashCode in class Object
      Returns:
      The hashcode.
    • equals

      public boolean equals(Object obj)
      Test if this object equals another.
      Specified by:
      equals in interface Map<T,E>
      Overrides:
      equals in class Object
      Parameters:
      obj - The other object.
      Returns:
      True, if equal.
    • toString

      public String toString()
      Get the string representation.
      Overrides:
      toString in class Object
      Returns:
      The string representation.
    • entryAdded

      protected abstract void entryAdded(T key, E value)
      An entry was added to the map.
    • entryRemoved

      protected abstract void entryRemoved(T key, E value)
      An entry was removed from the map.
    • entryChanged

      protected abstract void entryChanged(T key, E oldvalue, E newvalue)
      An entry was changed in the map.
    • entriesAdded

      protected void entriesAdded(Set<Map.Entry<T,E>> entries)
      Entries were added to the map.
    • entriesRemoved

      protected void entriesRemoved(Set<Map.Entry<T,E>> entries)
      Entries were removed from the map.