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 boolean
addAllElements(java.util.Collection<E> elements)
boolean
addElement(E element)
void
clear()
protected void
containerModified()
Called outside synchronized(this).protected void
doActivate()
protected void
doDeactivate()
protected void
elementAdded(E element)
Called inside synchronized(this).protected void
elementRemoved(E element)
Called inside synchronized(this).java.lang.Class<E>
getComponentType()
E[]
getElements()
IContainer.Persistence<E>
getPersistence()
protected java.util.Set<E>
getSet()
boolean
isEmpty()
boolean
isSavedWhenModified()
void
load()
boolean
removeAllElements(java.util.Collection<E> elements)
boolean
removeElement(E element)
void
save()
void
setPersistence(IContainer.Persistence<E> persistence)
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, 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:
getPersistence
in interfaceIContainer.Persistable<E>
- Since:
- 3.5
-
setPersistence
public final void setPersistence(IContainer.Persistence<E> persistence)
- Specified by:
setPersistence
in interfaceIContainer.Persistable<E>
- Since:
- 3.5
-
isSavedWhenModified
public boolean isSavedWhenModified()
- Since:
- 3.5
-
isEmpty
public boolean isEmpty()
-
getElements
public E[] getElements()
- Specified by:
getElements
in interfaceIContainer<E>
-
addElement
public boolean addElement(E element)
- Specified by:
addElement
in interfaceIContainer.Modifiable<E>
-
addAllElements
public boolean addAllElements(java.util.Collection<E> elements)
- Specified by:
addAllElements
in interfaceIContainer.Modifiable<E>
- Since:
- 3.5
-
removeElement
public boolean removeElement(E element)
- Specified by:
removeElement
in interfaceIContainer.Modifiable<E>
-
removeAllElements
public boolean removeAllElements(java.util.Collection<E> elements)
- Specified by:
removeAllElements
in interfaceIContainer.Modifiable<E>
- Since:
- 3.5
-
clear
public void clear()
-
load
public void load() throws IORuntimeException
- Specified by:
load
in interfaceIContainer.Persistable<E>
- Throws:
IORuntimeException
- Since:
- 3.5
-
save
public void save() throws IORuntimeException
- Specified by:
save
in interfaceIContainer.Persistable<E>
- Throws:
IORuntimeException
- Since:
- 3.5
-
doActivate
protected void doActivate() throws java.lang.Exception
- Overrides:
doActivate
in classLifecycle
- Throws:
java.lang.Exception
-
doDeactivate
protected void doDeactivate() throws java.lang.Exception
- Overrides:
doDeactivate
in 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
-
-