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

## ru.rsdn.patterns.behavioral.observer
Class Publisher<S>

    java.lang.Object
      ru.rsdn.patterns.behavioral.observer.Publisher<S>

Type Parameters:
  `S` - тип подписчика

Direct Known Subclasses:
  ConcretePublisher, Model

    public abstract class Publisher<S>

extends java.lang.Object

Издатель, использующий слабую связь с подписчиками

Field Summary
`private java.util.Collection<java.lang.ref.WeakReference<S>>` | `subscribers`

Constructor Summary
`Publisher()`

Method Summary
`protected java.util.Collection<S>` | `getSubscribers()`
`void` | `subscribe(S subscriber)` Подписаться
`void` | `unsubscribe(S subscriber)` Отписаться

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

Field Detail

### subscribers

    private final java.util.Collection<java.lang.ref.WeakReference<S>> subscribers

Constructor Detail

### Publisher

    public Publisher()

Method Detail

### subscribe

    public void subscribe(S subscriber)

  Подписаться

  Parameters:
    `subscriber` - подписчик

### unsubscribe

    public void unsubscribe(S subscriber)

  Отписаться

  Parameters:
    `subscriber` - подписчик

### getSubscribers

    protected java.util.Collection<S> getSubscribers()

  Returns:
    подписчики

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