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.DeferrableActivation
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
INotifier.INotifier2
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addAllElements
(Collection<E> elements) boolean
addElement
(E element) protected abstract boolean
backingStoreAdd
(E element) protected abstract void
protected abstract boolean
backingStoreContains
(E element) protected abstract void
backingStoreForEach
(Consumer<E> consumer) protected abstract boolean
protected abstract boolean
backingStoreRemove
(E element) protected abstract int
protected abstract E[]
backingStoreToArray
(E[] a) void
clear()
protected void
Called outside synchronized(this).protected void
elementAdded
(E element) Called inside synchronized(this).protected void
elementRemoved
(E element) Called inside synchronized(this).protected void
firstElementAdded
(E element) Called inside synchronized(this).E[]
boolean
isEmpty()
protected void
lastElementRemoved
(E element) Called inside synchronized(this).boolean
removeAllElements
(Collection<E> elements) boolean
removeElement
(E element) protected E[]
sortElements
(E[] array) Called outside synchronized(this).protected boolean
validateElement
(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, newContainerEvent
Methods 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, toString
Methods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, addUniqueListener, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:
getElements
in interfaceIContainer<E>
-
addElement
- Specified by:
addElement
in interfaceIContainer.Modifiable<E>
-
addAllElements
- Specified by:
addAllElements
in interfaceIContainer.Modifiable<E>
-
removeElement
- Specified by:
removeElement
in interfaceIContainer.Modifiable<E>
-
removeAllElements
- Specified by:
removeAllElements
in 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). -
firstElementAdded
Called inside synchronized(this).- Since:
- 3.24
-
elementAdded
Called inside synchronized(this). -
elementRemoved
Called inside synchronized(this). -
lastElementRemoved
Called inside synchronized(this).- Since:
- 3.24
-
backingStoreIsEmpty
protected abstract boolean backingStoreIsEmpty() -
backingStoreSize
protected abstract int backingStoreSize() -
backingStoreToArray
-
backingStoreForEach
-
backingStoreContains
-
backingStoreAdd
-
backingStoreRemove
-
backingStoreClear
protected abstract void backingStoreClear()
-