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.ModifiableContainer<E>
org.eclipse.net4j.util.container.PersistableContainer<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 PersistableContainer<E>
An implementation of a `container` that stores its `elements` in a `set`.

Since:
  3.2
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

### Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle

`USE_LABEL`

## Constructor Summary

Constructors
Constructor
Description
`SetContainer(Class<E> componentType)`
`SetContainer(Class<E> componentType, Set<E> set)`

## Method Summary

Modifier and Type
Method
Description
`protected boolean`
`backingStoreAdd(E element)`
`protected void`
`backingStoreClear()`
`protected boolean`
`backingStoreContains(E element)`
`protected void`
`backingStoreForEach(Consumer<E> consumer)`
`protected boolean`
`backingStoreIsEmpty()`
`protected boolean`
`backingStoreRemove(E element)`
`protected int`
`backingStoreSize()`
`protected E[]`
`backingStoreToArray(E[] a)`
`protected Set<E>`
`getSet()`

### Methods inherited from class org.eclipse.net4j.util.container.PersistableContainer

`containerModified, doActivate, doDeactivate, getPersistence, isSavedWhenModified, load, save, setPersistence`

### Methods inherited from class org.eclipse.net4j.util.container.ModifiableContainer

`addAllElements, addElement, clear, elementAdded, elementRemoved, getComponentType, getElements, isEmpty, removeAllElements, removeElement, sortElements, validateElement`

### 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.container.IContainer

`getElements, isEmpty`

### Methods inherited from interface org.eclipse.net4j.util.event.INotifier

`addListener, getListeners, hasListeners, removeListener`

## Constructor Details

### SetContainer

public SetContainer(Class<E> componentType)

### SetContainer

public SetContainer(Class<E> componentType, Set<E> set)

## Method Details

### getSet

protected Set<E> getSet()

### backingStoreIsEmpty

protected boolean backingStoreIsEmpty()

Specified by:
  `backingStoreIsEmpty` in class `ModifiableContainer<E>`

### backingStoreSize

protected int backingStoreSize()

Specified by:
  `backingStoreSize` in class `ModifiableContainer<E>`

### backingStoreToArray

protected E[] backingStoreToArray(E[] a)

Specified by:
  `backingStoreToArray` in class `ModifiableContainer<E>`

### backingStoreForEach

protected void backingStoreForEach(Consumer<E> consumer)

Specified by:
  `backingStoreForEach` in class `ModifiableContainer<E>`

### backingStoreContains

protected boolean backingStoreContains(E element)

Specified by:
  `backingStoreContains` in class `ModifiableContainer<E>`

### backingStoreAdd

protected boolean backingStoreAdd(E element)

Specified by:
  `backingStoreAdd` in class `ModifiableContainer<E>`

### backingStoreRemove

protected boolean backingStoreRemove(E element)

Specified by:
  `backingStoreRemove` in class `ModifiableContainer<E>`

### backingStoreClear

protected void backingStoreClear()

Specified by:
  `backingStoreClear` in class `ModifiableContainer<E>`