12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
- package subscriber;
-
- import java.util.concurrent.Flow.Subscriber;
- import java.util.concurrent.Flow.Subscription;
-
- /**
- *
- * @author le
- */
- public class WertAdapter implements Subscriber<Integer>
- {
- private SubscriberView view;
- private Datenmodell3 model;
- private Subscription subscription;
-
- public WertAdapter(SubscriberView view, Datenmodell3 model)
- {
- this.view = view;
- this.model = model;
- }
-
- public void einschreiben()
- {
- model.addWertSubscription(this);
- }
-
- @Override
- public void onSubscribe(Subscription subscription)
- {
- this.subscription = subscription;
- subscription.request(1);
- }
-
- @Override
- public void onNext(Integer item)
- {
- view.getLblZahl().setText(String.valueOf(item));
- subscription.request(1);
- }
-
- @Override
- public void onError(Throwable throwable)
- {
- }
-
- @Override
- public void onComplete()
- {
- }
-
-
- }
|