Class SingletonAdapterImpl

java.lang.Object
org.eclipse.emf.common.notify.impl.SingletonAdapterImpl
All Implemented Interfaces:
Adapter, Adapter.Internal

public class SingletonAdapterImpl extends Object implements Adapter.Internal
An alternate, extensible adapter implementation that is well suited to adapt for a number of objects (typically all objects of a given type).
Since:
2.2
  • Field Details

    • targets

      protected List<Notifier> targets
      The list of all the targets to which this adapter is set.
  • Constructor Details

    • SingletonAdapterImpl

      public SingletonAdapterImpl()
      Creates an instance.
  • Method Details

    • isAdapterForType

      public boolean isAdapterForType(Object type)
      Returns false
      Specified by:
      isAdapterForType in interface Adapter
      Parameters:
      type - the type.
      Returns:
      false
      See Also:
    • notifyChanged

      public void notifyChanged(Notification msg)
      Does nothing; clients may override so that it does something.
      Specified by:
      notifyChanged in interface Adapter
      Parameters:
      msg - a description of the change.
    • getTarget

      public Notifier getTarget()
      Description copied from interface: Adapter
      Returns the target from which the adapter receives notification. In general, an adapter may be shared by more than one notifier.
      Specified by:
      getTarget in interface Adapter
      Returns:
      the target notifier.
      See Also:
    • setTarget

      public void setTarget(Notifier target)
      Description copied from interface: Adapter
      Sets the target from which the adapter will receive notification. This method is only to be called by a notifier when this adapter is added to or removed from its adapter list. In general, an adapter may be shared by more than one notifier.
      Specified by:
      setTarget in interface Adapter
      Parameters:
      target - the new notifier.
      See Also:
    • unsetTarget

      public void unsetTarget(Notifier target)
      Description copied from interface: Adapter.Internal
      Unsets the target from which the adapter will receive notification. This method is only to be called by a notifier when this adapter is removed from its adapter list. In general, an adapter may be shared by more than one notifier, so this mechanism allows the adapter to know specifically which notifier will no longer be notifying.
      Specified by:
      unsetTarget in interface Adapter.Internal
      Parameters:
      target - the old notifier.
      See Also:
    • dispose

      public void dispose()
      Removes the adapter from all its targets.