本文整理汇总了Java中io.reactivex.disposables.Disposable.isDisposed方法的典型用法代码示例。如果您正苦于以下问题:Java Disposable.isDisposed方法的具体用法?Java Disposable.isDisposed怎么用?Java Disposable.isDisposed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.reactivex.disposables.Disposable
的用法示例。
在下文中一共展示了Disposable.isDisposed方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unregister
import io.reactivex.disposables.Disposable; //导入方法依赖的package包/类
/**
* 取消订阅
*
* @param tag 标志
* @return true 取消成功
*/
public boolean unregister(@NonNull Object tag) {
RxBusEvent rxBusEvent = rxBusEventArrayMap.get(tag);
if (RxUtils.isEmpty(rxBusEvent)) {
return true;
}
Subject<Object> subject = rxBusEvent.subject;
Disposable disposable = rxBusEvent.disposable;
if (!disposable.isDisposed()) {
disposable.dispose();
}
if (!subject.hasObservers()) {
rxBusEventArrayMap.remove(tag);
return true;
}
return false;
}
示例2: destroy
import io.reactivex.disposables.Disposable; //导入方法依赖的package包/类
@Override
public void destroy() {
if (subs == null) return;
for (Disposable disposable : subs)
if (!disposable.isDisposed()) disposable.dispose();
subs.clear();
subs = null;
}
示例3: onDestroy
import io.reactivex.disposables.Disposable; //导入方法依赖的package包/类
@Override
protected void onDestroy() {
super.onDestroy();
for (int i = 0; i < dLists.size(); i++) {
Disposable disposable = dLists.get(i);
if (null != disposable && !disposable.isDisposed()) {
disposable.dispose();
}
}
}
示例4: safelyDispose
import io.reactivex.disposables.Disposable; //导入方法依赖的package包/类
private void safelyDispose(Disposable... disposables) {
for (Disposable subscription : disposables) {
if (subscription != null && !subscription.isDisposed()) {
subscription.dispose();
}
}
}
示例5: unSubscribeByEventType
import io.reactivex.disposables.Disposable; //导入方法依赖的package包/类
/**
* subscriptions unsubscribe
*
* @param eventType eventType
*/
private void unSubscribeByEventType(Class eventType) {
List<Disposable> disposables = subscriptionsByEventType.get(eventType);
if (disposables != null) {
Iterator<Disposable> iterator = disposables.iterator();
while (iterator.hasNext()) {
Disposable disposable = iterator.next();
if (disposable != null && !disposable.isDisposed()) {
disposable.dispose();
iterator.remove();
}
}
}
}
示例6: cancel
import io.reactivex.disposables.Disposable; //导入方法依赖的package包/类
public void cancel(@NonNull Object tag) {
Disposable disposable = arrayMap.get(tag);
if (!RxUtils.isEmpty(disposable) && !disposable.isDisposed()) {
disposable.dispose();
arrayMap.remove(tag);
}
}
示例7: clearQueue
import io.reactivex.disposables.Disposable; //导入方法依赖的package包/类
public void clearQueue() {
Log.d(TAG, "clearQueue: size to be cleared=" + mLoadingDetections.size());
// For each of the loading detections dispose it and remove it. Fuck em off
Iterator<Map.Entry<String, Disposable>> iterator = mLoadingDetections.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<String, Disposable> entry = iterator.next();
Disposable disposable = entry.getValue();
if (!disposable.isDisposed()) {
disposable.dispose();
}
iterator.remove();
}
}
示例8: detachView
import io.reactivex.disposables.Disposable; //导入方法依赖的package包/类
@Override
public void detachView() {
for (Disposable disposable : disposables) {
if (!disposable.isDisposed()) disposable.dispose();
}
mView = null;
}
示例9: dispose
import io.reactivex.disposables.Disposable; //导入方法依赖的package包/类
public static void dispose(Disposable disposable) {
if (disposable != null && !disposable.isDisposed()) {
disposable.dispose();
}
}
示例10: safelyDispose
import io.reactivex.disposables.Disposable; //导入方法依赖的package包/类
public static void safelyDispose(Disposable disposable) {
if (Objects.nonNull(disposable) && !disposable.isDisposed()) {
disposable.dispose();
}
}
示例11: disposeSafety
import io.reactivex.disposables.Disposable; //导入方法依赖的package包/类
public static void disposeSafety(Disposable disposable) {
if (disposable != null && !disposable.isDisposed()) {
disposable.dispose();
}
}
示例12: cancelSubscription
import io.reactivex.disposables.Disposable; //导入方法依赖的package包/类
/**
* 取消订阅
*/
public static void cancelSubscription(Disposable disposable) {
if (disposable != null && !disposable.isDisposed()) {
disposable.dispose();
}
}
示例13: unregister
import io.reactivex.disposables.Disposable; //导入方法依赖的package包/类
public void unregister(Disposable disposable) {
if (disposable != null && !disposable.isDisposed()) {
disposable.dispose();
}
}