Package org.eclipse.net4j.util.container
Class ModifiableContainer<E>
java.lang.Object
org.eclipse.net4j.util.event.Notifier
org.eclipse.net4j.util.lifecycle.Lifecycle
org.eclipse.net4j.util.lifecycle.ShareableLifecycle
org.eclipse.net4j.util.container.Container<E>
org.eclipse.net4j.util.container.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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainer
IContainer.Modifiable<E>, IContainer.Persistable<E>, IContainer.Persistence<E>Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
ILifecycle.DeferrableActivationNested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
INotifier.INotifier2 -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAllElements(Collection<E> elements) booleanaddElement(E element) protected abstract booleanbackingStoreAdd(E element) protected abstract voidprotected abstract booleanbackingStoreContains(E element) protected abstract voidbackingStoreForEach(Consumer<E> consumer) protected abstract booleanprotected abstract booleanbackingStoreRemove(E element) protected abstract intprotected abstract E[]backingStoreToArray(E[] a) voidclear()protected voidCalled outside synchronized(this).protected voidelementAdded(E element) Called inside synchronized(this).protected voidelementRemoved(E element) Called inside synchronized(this).E[]booleanisEmpty()booleanremoveAllElements(Collection<E> elements) booleanremoveElement(E element) protected E[]sortElements(E[] array) Called outside synchronized(this).protected booleanvalidateElement(E element) Called outside synchronized(this).Methods inherited from class org.eclipse.net4j.util.container.Container
fireContainerEvent, fireContainerEvent, fireContainerEvent, fireElementAddedEvent, fireElementRemovedEvent, fireElementsAddedEvent, fireElementsRemovedEvent, fireEvent, newContainerEvent, newContainerEventMethods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, doDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toStringMethods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, addUniqueListener, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListener
-
Constructor Details
-
ModifiableContainer
-
-
Method Details
-
getComponentType
-
isEmpty
public boolean isEmpty() -
getElements
- Specified by:
getElementsin interfaceIContainer<E>
-
addElement
- Specified by:
addElementin interfaceIContainer.Modifiable<E>
-
addAllElements
- Specified by:
addAllElementsin interfaceIContainer.Modifiable<E>
-
removeElement
- Specified by:
removeElementin interfaceIContainer.Modifiable<E>
-
removeAllElements
- Specified by:
removeAllElementsin interfaceIContainer.Modifiable<E>
-
clear
public void clear() -
sortElements
Called outside synchronized(this). -
validateElement
Called outside synchronized(this). -
containerModified
protected void containerModified()Called outside synchronized(this). -
elementAdded
Called inside synchronized(this). -
elementRemoved
Called inside synchronized(this). -
backingStoreIsEmpty
protected abstract boolean backingStoreIsEmpty() -
backingStoreSize
protected abstract int backingStoreSize() -
backingStoreToArray
-
backingStoreForEach
-
backingStoreContains
-
backingStoreAdd
-
backingStoreRemove
-
backingStoreClear
protected abstract void backingStoreClear()
-