Interface ILcdList<T>

All Superinterfaces:
Collection<T>, ILcdCollection<T>, Iterable<T>, List<T>, SequencedCollection<T>
All Known Implementing Classes:
TLcdArrayList

public interface ILcdList<T> extends ILcdCollection<T>, List<T>

An extension of the Java List which fires an TLcdCollectionEvent and TLcdListEvent for every element that is added to or removed from the list.

Due to those events, there is a decrease in performance compared to the traditional List when adding and/or removing multiple elements at once (e.g. ILcdCollection.addAll(java.util.Collection) or ILcdCollection.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(int aIndex, 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 List<T>
    • set

      T set(int aIndex, T aElement)

      Replacing the element should be performed in two distinct steps. First the removal of the element (including an event) and afterwards the adding of the new element (including an event).

      Specified by:
      set in interface List<T>
    • addListListener

      void addListListener(ILcdListListener<T> aListListener)

      Register the listener aListListener to be informed about changes in this list.

      Parameters:
      aListListener - the listener
      See Also:
    • removeListListener

      void removeListListener(ILcdListListener<T> aListListener)

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

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

      Parameters:
      aListListener - the listener
      See Also: