Overview | Package | Class | Use | Tree | Deprecated | Index
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.emf.ecp.internal.core.util
Class Registry<ELEMENT,OBSERVER extends ECPObserver>

    java.lang.Object
      org.eclipse.net4j.util.event.Notifier
          org.eclipse.net4j.util.lifecycle.Lifecycle
              org.eclipse.emf.ecp.internal.core.util.Registry<ELEMENT,OBSERVER>

Type Parameters:
  `ELEMENT` -
  `OBSERVER` -

All Implemented Interfaces:
  ECPDisposable.DisposeListener, org.eclipse.net4j.util.event.INotifier, org.eclipse.net4j.util.lifecycle.ILifecycle, org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation

Direct Known Subclasses:
  ElementRegistry, Properties

    public abstract class Registry<ELEMENT,OBSERVER extends ECPObserver>

extends org.eclipse.net4j.util.lifecycle.Lifecycle
implements ECPDisposable.DisposeListener

Author:
  Eike Stepper

Nested Class Summary

Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
`org.eclipse.net4j.util.lifecycle.ILifecycle.DeferrableActivation`

Field Summary

Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
`USE_LABEL`

Constructor Summary
`Registry()` Default constructor.

Method Summary
`void` | `addObserver(OBSERVER observer)` Adds an `ECPObserver` to the `ECPObserverBus`.
`void` | `changeElements(Set<String> remove, Set<ELEMENT> add)` Adds or remove elements contained in the registry.
`void` | `disposed(ECPDisposable disposable)` Callback method being used to notify listeners about a dispose.
`ELEMENT` | `getElement(String key)` Retrieves an element with a certain name from the registry.
`int` | `getElementCount()` Returns the number of elements managed by the registry.
`Set<String>` | `getElementNames()` Returns the names of the elements managed by the registry.
`Collection<ELEMENT>` | `getElements()` Returns the list of elements managed by the registry.
`boolean` | `hasElement(String name)` Checks if an element with a certain name is managed by the registry.
`boolean` | `hasElements()` Returns if the registry has elements.
`void` | `removeObserver(OBSERVER observer)` Removes an `ECPObserver` to the `ECPObserverBus`.

Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
`activate, deactivate, getLifecycleState, isActive, isDeferredActivation, toString`

Methods inherited from class org.eclipse.net4j.util.event.Notifier
`addListener, fireEvent, fireEvent, fireEvent, getListeners, hasListeners, removeListener`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.eclipse.net4j.util.event.INotifier
`addListener, getListeners, hasListeners, removeListener`

Constructor Detail

### Registry

    public Registry()

  Default constructor.

Method Detail

### getElement

    public final ELEMENT getElement(String key)

  Retrieves an element with a certain name from the registry.

  Parameters:
    `key` - the name of the element to retrieve
  Returns:
    the element or null if not contained in the registry

### getElementNames

    public final Set<String> getElementNames()

  Returns the names of the elements managed by the registry.

  Returns:
    a set of strings representing the names of elements

### getElementCount

    public final int getElementCount()

  Returns the number of elements managed by the registry.

  Returns:
    an integer

### getElements

    public final Collection<ELEMENT> getElements()

  Returns the list of elements managed by the registry.

  Returns:
    a collection of elements

### hasElements

    public final boolean hasElements()

  Returns if the registry has elements.

  Returns:
    true if the registry has elements

### hasElement

    public final boolean hasElement(String name)

  Checks if an element with a certain name is managed by the registry.

  Parameters:
    `name` - the name of the element to check
  Returns:
    true if the element is managed by the registry

### changeElements

    public final void changeElements(Set<String> remove,
                                     Set<ELEMENT> add)

  Adds or remove elements contained in the registry.

  Parameters:
    `remove` - a set of elements to be removed
    `add` - a set of elements to be added

### disposed

    public final void disposed(ECPDisposable disposable)

  Callback method being used to notify listeners about a dispose.

  Specified by:
    `disposed` in interface `ECPDisposable.DisposeListener`
  Parameters:
    `disposable` - the object being disposed

### addObserver

    public void addObserver(OBSERVER observer)

  Adds an `ECPObserver` to the `ECPObserverBus`.

  Parameters:
    `observer` - the observer to be added

### removeObserver

    public void removeObserver(OBSERVER observer)

  Removes an `ECPObserver` to the `ECPObserverBus`.

  Parameters:
    `observer` - the observer to be removed

Overview | Package | Class | Use | Tree | Deprecated | Index
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2015. All Rights Reserved.