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>
- Type Parameters:
E- the element type
- 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 class Notifier
Notifier.CancelationNested classes/interfaces inherited from interface IContainer
IContainer.Modifiable<E>, IContainer.Persistable<E>, IContainer.Persistence<E>Nested classes/interfaces inherited from interface ILifecycle
ILifecycle.DeferrableActivationNested classes/interfaces inherited from interface 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).protected voidfirstElementAdded(E element) Called inside synchronized(this).E[]booleanisEmpty()protected voidlastElementRemoved(E element) Called inside synchronized(this).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 Container
fireContainerEvent, fireContainerEvent, fireContainerEvent, fireElementAddedEvent, fireElementRemovedEvent, fireElementsAddedEvent, fireElementsRemovedEvent, fireEvent, newContainerEvent, newContainerEventMethods inherited from class Lifecycle
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, doCancelActivation, doDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toStringMethods inherited from class Notifier
addListener, addUniqueListener, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListenerMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface INotifier
addListener, getListeners, hasListeners, removeListener
-
Constructor Details
-
ModifiableContainer
-
-
Method Details
-
getComponentType
-
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
-
validateElement
Called outside synchronized(this). -
containerModified
protected void containerModified()Called outside synchronized(this). -
firstElementAdded
-
elementAdded
Called inside synchronized(this). -
elementRemoved
Called inside synchronized(this). -
lastElementRemoved
-
backingStoreIsEmpty
protected abstract boolean backingStoreIsEmpty() -
backingStoreSize
protected abstract int backingStoreSize() -
backingStoreToArray
-
backingStoreForEach
-
backingStoreContains
-
backingStoreAdd
-
backingStoreRemove
-
backingStoreClear
protected abstract void backingStoreClear()
-