Class ModifiableContainer<E>

All Implemented Interfaces:
IContainer<E>, IContainer.Modifiable<E>, INotifier, INotifier.INotifier2, IDeactivateable, ILifecycle, ILifecycle.DeferrableActivation
Direct Known Subclasses:
PersistableContainer

public abstract class ModifiableContainer<E> extends Container<E> implements IContainer.Modifiable<E>
An abstract implementation of a modifiable container.
Since:
3.18
Author:
Eike Stepper
  • Constructor Details

    • ModifiableContainer

      public ModifiableContainer(Class<E> componentType)
  • Method Details

    • getComponentType

      public final Class<E> getComponentType()
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface IContainer<E>
      Overrides:
      isEmpty in class Container<E>
    • getElements

      public E[] getElements()
      Specified by:
      getElements in interface IContainer<E>
    • addElement

      public boolean addElement(E element)
      Specified by:
      addElement in interface IContainer.Modifiable<E>
    • addAllElements

      public boolean addAllElements(Collection<E> elements)
      Specified by:
      addAllElements in interface IContainer.Modifiable<E>
    • removeElement

      public boolean removeElement(E element)
      Specified by:
      removeElement in interface IContainer.Modifiable<E>
    • removeAllElements

      public boolean removeAllElements(Collection<E> elements)
      Specified by:
      removeAllElements in interface IContainer.Modifiable<E>
    • clear

      public void clear()
    • sortElements

      protected E[] sortElements(E[] array)
      Called outside synchronized(this).
    • validateElement

      protected boolean validateElement(E element)
      Called outside synchronized(this).
    • containerModified

      protected void containerModified()
      Called outside synchronized(this).
    • elementAdded

      protected void elementAdded(E element)
      Called inside synchronized(this).
    • elementRemoved

      protected void elementRemoved(E element)
      Called inside synchronized(this).
    • backingStoreIsEmpty

      protected abstract boolean backingStoreIsEmpty()
    • backingStoreSize

      protected abstract int backingStoreSize()
    • backingStoreToArray

      protected abstract E[] backingStoreToArray(E[] a)
    • backingStoreForEach

      protected abstract void backingStoreForEach(Consumer<E> consumer)
    • backingStoreContains

      protected abstract boolean backingStoreContains(E element)
    • backingStoreAdd

      protected abstract boolean backingStoreAdd(E element)
    • backingStoreRemove

      protected abstract boolean backingStoreRemove(E element)
    • backingStoreClear

      protected abstract void backingStoreClear()