Package org.eclipse.net4j.util.container
Class SetContainer<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.SetContainer<E>
-
- All Implemented Interfaces:
IContainer<E>,IContainer.Modifiable<E>,IContainer.Persistable<E>,INotifier,INotifier.INotifier2,IDeactivateable,ILifecycle,ILifecycle.DeferrableActivation
public class SetContainer<E> extends Container<E> implements IContainer.Modifiable<E>, IContainer.Persistable<E>
- Since:
- 3.2
- Author:
- Eike Stepper
- See Also:
IContainerSet,IContainerSortedSet
-
-
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
-
-
Constructor Summary
Constructors Constructor Description SetContainer(java.lang.Class<E> componentType)SetContainer(java.lang.Class<E> componentType, java.util.Set<E> set)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddAllElements(java.util.Collection<E> elements)booleanaddElement(E element)voidclear()protected voidcontainerModified()Called outside synchronized(this).protected voiddoActivate()protected voiddoDeactivate()protected voidelementAdded(E element)Called inside synchronized(this).protected voidelementRemoved(E element)Called inside synchronized(this).java.lang.Class<E>getComponentType()E[]getElements()IContainer.Persistence<E>getPersistence()protected java.util.Set<E>getSet()booleanisEmpty()booleanisSavedWhenModified()voidload()booleanremoveAllElements(java.util.Collection<E> elements)booleanremoveElement(E element)voidsave()voidsetPersistence(IContainer.Persistence<E> persistence)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, newContainerEvent
-
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, 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
-
-
-
-
Method Detail
-
getComponentType
public final java.lang.Class<E> getComponentType()
-
getPersistence
public final IContainer.Persistence<E> getPersistence()
- Specified by:
getPersistencein interfaceIContainer.Persistable<E>- Since:
- 3.5
-
setPersistence
public final void setPersistence(IContainer.Persistence<E> persistence)
- Specified by:
setPersistencein interfaceIContainer.Persistable<E>- Since:
- 3.5
-
isSavedWhenModified
public boolean isSavedWhenModified()
- Since:
- 3.5
-
isEmpty
public boolean isEmpty()
-
getElements
public E[] getElements()
- Specified by:
getElementsin interfaceIContainer<E>
-
addElement
public boolean addElement(E element)
- Specified by:
addElementin interfaceIContainer.Modifiable<E>
-
addAllElements
public boolean addAllElements(java.util.Collection<E> elements)
- Specified by:
addAllElementsin interfaceIContainer.Modifiable<E>- Since:
- 3.5
-
removeElement
public boolean removeElement(E element)
- Specified by:
removeElementin interfaceIContainer.Modifiable<E>
-
removeAllElements
public boolean removeAllElements(java.util.Collection<E> elements)
- Specified by:
removeAllElementsin interfaceIContainer.Modifiable<E>- Since:
- 3.5
-
clear
public void clear()
-
load
public void load() throws IORuntimeException- Specified by:
loadin interfaceIContainer.Persistable<E>- Throws:
IORuntimeException- Since:
- 3.5
-
save
public void save() throws IORuntimeException- Specified by:
savein interfaceIContainer.Persistable<E>- Throws:
IORuntimeException- Since:
- 3.5
-
doActivate
protected void doActivate() throws java.lang.Exception- Overrides:
doActivatein classLifecycle- Throws:
java.lang.Exception
-
doDeactivate
protected void doDeactivate() throws java.lang.Exception- Overrides:
doDeactivatein classLifecycle- Throws:
java.lang.Exception
-
getSet
protected java.util.Set<E> getSet()
-
validateElement
protected boolean validateElement(E element)
Called outside synchronized(this).
-
containerModified
protected void containerModified()
Called outside synchronized(this).- Since:
- 3.5
-
elementAdded
protected void elementAdded(E element)
Called inside synchronized(this).- Since:
- 3.5
-
elementRemoved
protected void elementRemoved(E element)
Called inside synchronized(this).- Since:
- 3.5
-
-