Class CollectionWrapper<T>

java.lang.Object
jadex.collection.CollectionWrapper<T>
All Implemented Interfaces:
Iterable<T>, Collection<T>
Direct Known Subclasses:
ListWrapper, SetWrapper

public abstract class CollectionWrapper<T> extends Object implements Collection<T>
Wrapper for collections. Creates rule events on add/remove/change operation calls.
  • Field Details

    • delegate

      protected Collection<T> delegate
      The delegate list.
  • Constructor Details

    • CollectionWrapper

      public CollectionWrapper(Collection<T> delegate)
      Create a new wrapper.
      Parameters:
      delegate - The delegate.
  • Method Details

    • size

      public int size()
      Get the size.
      Specified by:
      size in interface Collection<T>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Collection<T>
    • contains

      public boolean contains(Object o)
      Specified by:
      contains in interface Collection<T>
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Collection<T>
      Specified by:
      iterator in interface Iterable<T>
    • toArray

      public Object[] toArray()
      Specified by:
      toArray in interface Collection<T>
    • toArray

      public <T> T[] toArray(T[] a)
      Specified by:
      toArray in interface Collection<T>
    • add

      public boolean add(T e)
      Specified by:
      add in interface Collection<T>
    • remove

      public boolean remove(Object o)
      Specified by:
      remove in interface Collection<T>
    • containsAll

      public boolean containsAll(Collection<?> c)
      Specified by:
      containsAll in interface Collection<T>
    • addAll

      public boolean addAll(Collection<? extends T> c)
      Specified by:
      addAll in interface Collection<T>
    • removeAll

      public boolean removeAll(Collection<?> c)
      Specified by:
      removeAll in interface Collection<T>
    • retainAll

      public boolean retainAll(Collection<?> c)
      Specified by:
      retainAll in interface Collection<T>
    • clear

      public void clear()
      Specified by:
      clear in interface Collection<T>
    • hashCode

      public int hashCode()
      Get the hashcode of the object.
      Specified by:
      hashCode in interface Collection<T>
      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 Collection<T>
      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 value, int index)
      An entry was added to the collection.
    • entryRemoved

      protected abstract void entryRemoved(T value, int index)
      An entry was removed from the collection.
    • entryChanged

      protected abstract void entryChanged(T oldvalue, T newvalue, int index)
      An entry was changed in the collection.