Interface ILcdCollection<T>

All Superinterfaces:
Collection<T>, Iterable<T>
All Known Subinterfaces:
ILcdList<T>
All Known Implementing Classes:
TLcdArrayList, TLspGraphicsEffects

public interface ILcdCollection<T> extends Collection<T>

An extension of the Java Collection which fires an TLcdCollectionEvent for every element that is added to or removed from the collection.

Due to those events, there is a decrease in performance compared to the traditional Collection when adding and/or removing multiple elements at once (e.g. addAll(java.util.Collection) or removeAll(java.util.Collection) ). For every element that is added or removed, those methods should fire an individual event. An example implementation for such a method is:


  public boolean addAll( Collection<? extends T> aCollection ) {
    boolean result = false;
    for ( T element : aCollection ) {
      result = add( element ) || result;
    }
    return result;
  }
 
Since:
9.1
See Also:
  • Method Details

    • addAll

      boolean addAll(Collection<? extends T> aCollection)

      The elements should be added to the Collection one by one, and an TLcdCollectionEvent fired each time an element has been added.

      Specified by:
      addAll in interface Collection<T>
    • removeAll

      boolean removeAll(Collection<?> aCollection)

      The elements should be removed from the Collection one by one, and an TLcdCollectionEvent fired each time an element has been removed.

      Specified by:
      removeAll in interface Collection<T>
    • retainAll

      boolean retainAll(Collection<?> aCollection)

      The elements should be removed from the Collection one by one, and an TLcdCollectionEvent fired each time an element has been removed.

      Specified by:
      retainAll in interface Collection<T>
    • clear

      void clear()

      The elements should be removed from the Collection one by one, and an TLcdCollectionEvent fired each time an element has been removed.

      Specified by:
      clear in interface Collection<T>
    • addCollectionListener

      void addCollectionListener(ILcdCollectionListener<T> aCollectionListener)

      Register the listener aCollectionListener to be informed about changes in this collection.

      Parameters:
      aCollectionListener - the listener
      See Also:
    • removeCollectionListener

      void removeCollectionListener(ILcdCollectionListener<T> aCollectionListener)

      Unregister the listener aCollectionListener so it will no longer be informed about changes in this collection.

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

      Parameters:
      aCollectionListener - the listener
      See Also: