當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。