当前位置: 首页>>代码示例>>Java>>正文


Java OpenHashSet类代码示例

本文整理汇总了Java中io.reactivex.internal.util.OpenHashSet的典型用法代码示例。如果您正苦于以下问题:Java OpenHashSet类的具体用法?Java OpenHashSet怎么用?Java OpenHashSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OpenHashSet类属于io.reactivex.internal.util包,在下文中一共展示了OpenHashSet类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dispose

import io.reactivex.internal.util.OpenHashSet; //导入依赖的package包/类
@Override
public void dispose() {
    if (!disposed) {
        OpenHashSet<Disposable> set;
        synchronized (this) {
            if (disposed) {
                return;
            }
            set = tasks;
            tasks = null;
            disposed = true;
        }

        Object[] keys = set.keys();
        for (Object o : keys) {
            if (o instanceof Disposable) {
                ((Disposable) o).dispose();
            }
        }
    }
}
 
开发者ID:akarnokd,项目名称:RxJava2Swing,代码行数:22,代码来源:AsyncSwingScheduler.java

示例2: add

import io.reactivex.internal.util.OpenHashSet; //导入依赖的package包/类
public boolean add(Subscription s) {
    if (!cancelled) {
        synchronized (this) {
            if (!cancelled) {
                OpenHashSet<Subscription> h = set;
                if (h == null) {
                    h = new OpenHashSet<Subscription>();
                    set = h;
                }
                h.add(s);
                return true;
            }
        }
    }
    s.cancel();
    return false;
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:18,代码来源:CompositeSubscription.java

示例3: cancel

import io.reactivex.internal.util.OpenHashSet; //导入依赖的package包/类
@Override
public void cancel() {
    if (!cancelled) {
        OpenHashSet<Subscription> h;
        synchronized (this) {
            if (cancelled) {
                return;
            }
            h = set;
            set = null;
            cancelled = true;
        }

        if (h != null) {
            Object[] array = h.keys();
            for (Object o : array) {
                if (o != null) {
                    ((Subscription)o).cancel();
                }
            }
        }
    }
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:24,代码来源:CompositeSubscription.java

示例4: dispose

import io.reactivex.internal.util.OpenHashSet; //导入依赖的package包/类
@Override
public void dispose() {
    if (!disposed) {
        OpenHashSet<WorkerTask> set;
        synchronized (this) {
            if (disposed) {
                return;
            }
            disposed = true;
            set = tasks;
            tasks = null;
        }

        Object[] o = set.keys();
        for (Object e : o) {
            if (e instanceof WorkerTask) {
                WorkerTask wt = (WorkerTask) e;
                wt.dispose();
            }
        }
    }
}
 
开发者ID:akarnokd,项目名称:akarnokd-misc,代码行数:23,代码来源:SingleResourceScheduler.java

示例5: delete

import io.reactivex.internal.util.OpenHashSet; //导入依赖的package包/类
public void delete(Subscription s) {
    if (!cancelled) {
        synchronized (this) {
            if (!cancelled) {
                OpenHashSet<Subscription> h = set;
                if (h != null) {
                    h.remove(s);
                }
            }
        }
    }
}
 
开发者ID:akarnokd,项目名称:RxJava2Extensions,代码行数:13,代码来源:CompositeSubscription.java

示例6: add

import io.reactivex.internal.util.OpenHashSet; //导入依赖的package包/类
boolean add(WorkerTask task) {
    synchronized (this) {
        OpenHashSet<WorkerTask> set = tasks;
        if (set != null) {
            set.add(task);
            return true;
        }
    }
    return false;
}
 
开发者ID:akarnokd,项目名称:akarnokd-misc,代码行数:11,代码来源:SingleResourceScheduler.java

示例7: delete

import io.reactivex.internal.util.OpenHashSet; //导入依赖的package包/类
void delete(WorkerTask task) {
    synchronized (this) {
        OpenHashSet<WorkerTask> set = tasks;
        if (set != null) {
            set.remove(task);
        }
    }
}
 
开发者ID:akarnokd,项目名称:akarnokd-misc,代码行数:9,代码来源:SingleResourceScheduler.java

示例8: AsyncSwingWorker

import io.reactivex.internal.util.OpenHashSet; //导入依赖的package包/类
AsyncSwingWorker() {
    this.tasks = new OpenHashSet<Disposable>();
}
 
开发者ID:akarnokd,项目名称:RxJava2Swing,代码行数:4,代码来源:AsyncSwingScheduler.java

示例9: SingleResourceWorker

import io.reactivex.internal.util.OpenHashSet; //导入依赖的package包/类
SingleResourceWorker() {
    this.tasks = new OpenHashSet<>();
}
 
开发者ID:akarnokd,项目名称:akarnokd-misc,代码行数:4,代码来源:SingleResourceScheduler.java


注:本文中的io.reactivex.internal.util.OpenHashSet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。