SubscribersNotifier Class
From Neurotech Software Development Kit
ru.neurotech.common
Contents
Class SubscribersNotifier<T>
- java.lang.Object
-
- ru.neurotech.common.SubscribersNotifier<T>
-
public class <span class="typeNameLabel">SubscribersNotifier<T></span> extends java.lang.Object
Create instance of this class to use notification mechanism for your subscribersUsage: public SubscribersNotifier<myParamType> myEvent = new SubscribersNotifier<myParamType>(); ... myEvent.sendNotification(param); ...
To subscribe do the following: private INotificationCallback<myParamType> _myScanCallback = new INotificationCallback<myParamType>() {</div> </li> </ul> </div>
-
- <a name="constructor.summary">
</a>
Constructor Summary
Constructors Constructor and Description <a href="../../../ru/neurotech/common/SubscribersNotifier.html#SubscribersNotifier--">SubscribersNotifier</a>()
- <a name="method.summary">
</a>
Method Summary
All Methods <a href="javascript:show(2);">Instance Methods</a> <a href="javascript:show(8);">Concrete Methods</a> Modifier and Type Method and Description void
<a href="../../../ru/neurotech/common/SubscribersNotifier.html#sendNotification-java.lang.Object-T-">sendNotification</a>(java.lang.Object sender,
<a href="../../../ru/neurotech/common/SubscribersNotifier.html" title="type parameter in SubscribersNotifier">T</a> param)
Sends notification to all subscribersvoid
<a href="../../../ru/neurotech/common/SubscribersNotifier.html#subscribe-ru.neurotech.common.INotificationCallback-">subscribe</a>(<a href="../../../ru/neurotech/common/INotificationCallback.html" title="interface in ru.neurotech.common">INotificationCallback</a><<a href="../../../ru/neurotech/common/SubscribersNotifier.html" title="type parameter in SubscribersNotifier">T</a>> callback)
Appends notifications subscribervoid
<a href="../../../ru/neurotech/common/SubscribersNotifier.html#unsubscribe--">unsubscribe</a>()
void
<a href="../../../ru/neurotech/common/SubscribersNotifier.html#unsubscribe-ru.neurotech.common.INotificationCallback-">unsubscribe</a>(<a href="../../../ru/neurotech/common/INotificationCallback.html" title="interface in ru.neurotech.common">INotificationCallback</a><<a href="../../../ru/neurotech/common/SubscribersNotifier.html" title="type parameter in SubscribersNotifier">T</a>> callback)
Removes subscriber from notification list- <a name="methods.inherited.from.class.java.lang.Object">
</a>
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- <a name="methods.inherited.from.class.java.lang.Object">
</a>
- <a name="constructor.summary">
</a>
-
- <a name="constructor.detail">
</a>
Constructor Detail
<a name="SubscribersNotifier--"> </a>
-
SubscribersNotifier
public SubscribersNotifier()
-
- <a name="method.detail">
</a>
Method Detail
<a name="subscribe-ru.neurotech.common.INotificationCallback-"> </a>
-
subscribe
public void subscribe(<a href="../../../ru/neurotech/common/INotificationCallback.html" title="interface in ru.neurotech.common">INotificationCallback</a><<a href="../../../ru/neurotech/common/SubscribersNotifier.html" title="type parameter in SubscribersNotifier">T</a>> callback)
Appends notifications subscriber- Parameters:
callback
- subscriber callback class
<a name="unsubscribe-ru.neurotech.common.INotificationCallback-"> </a>
-
unsubscribe
public void unsubscribe(<a href="../../../ru/neurotech/common/INotificationCallback.html" title="interface in ru.neurotech.common">INotificationCallback</a><<a href="../../../ru/neurotech/common/SubscribersNotifier.html" title="type parameter in SubscribersNotifier">T</a>> callback)
Removes subscriber from notification list- Parameters:
callback
-
<a name="unsubscribe--"> </a>
-
unsubscribe
public void unsubscribe()
<a name="sendNotification-java.lang.Object-java.lang.Object-"> </a><a name="sendNotification-java.lang.Object-T-"> </a>
-
sendNotification
public void sendNotification(java.lang.Object sender, <a href="../../../ru/neurotech/common/SubscribersNotifier.html" title="type parameter in SubscribersNotifier">T</a> param)
Sends notification to all subscribers- Parameters:
param
- notification data
-
- <a name="constructor.detail">
</a>
-