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.mvc.model
Class Model<P>

    java.lang.Object
      ru.rsdn.patterns.behavioral.observer.Publisher<IModelSubscriber<P>>
          ru.rsdn.patterns.mvc.model.Model<P>

Type Parameters:
  `P` - свойство модели

Direct Known Subclasses:
  ListModel

    public class Model<P>

extends Publisher<IModelSubscriber<P>>

Модель

Field Summary
`private java.util.concurrent.locks.ReentrantLock` | `lock`
`private java.util.concurrent.atomic.AtomicReference<P>` | `ref`

Constructor Summary
`Model(P property)`

Method Summary
`P` | `getProperty()`
`private void` | `notifySubscriber(IModelSubscriber<P> subscriber)`
`protected void` | `notifySubscribers()` Оповестить всех подписчиков
`void` | `setProperty(P property)` Установить свойство модели
`void` | `subscribe(IModelSubscriber<P> subscriber)`
`java.lang.String` | `toString()`

Methods inherited from class ru.rsdn.patterns.behavioral.observer.Publisher
`getSubscribers, unsubscribe`

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

Field Detail

### ref

    private final java.util.concurrent.atomic.AtomicReference<P> ref

### lock

    private final java.util.concurrent.locks.ReentrantLock lock

Constructor Detail

### Model

    public Model(P property)

Method Detail

### getProperty

    public P getProperty()

  Returns:
    свойство модели

### setProperty

    public void setProperty(P property)

  Установить свойство модели

  Parameters:
    `property` - свойство модели

### notifySubscribers

    protected void notifySubscribers()

  Оповестить всех подписчиков

### notifySubscriber

    private void notifySubscriber(IModelSubscriber<P> subscriber)

### subscribe

    public void subscribe(IModelSubscriber<P> subscriber)

  Overrides:
    `subscribe` in class `Publisher<IModelSubscriber<P>>`
  Parameters:
    `subscriber` - подписчик

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

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