本文整理匯總了Java中com.nostra13.universalimageloader.core.assist.QueueProcessingType.LIFO屬性的典型用法代碼示例。如果您正苦於以下問題:Java QueueProcessingType.LIFO屬性的具體用法?Java QueueProcessingType.LIFO怎麽用?Java QueueProcessingType.LIFO使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.nostra13.universalimageloader.core.assist.QueueProcessingType
的用法示例。
在下文中一共展示了QueueProcessingType.LIFO屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createExecutor
/** Creates default implementation of task executor */
public static Executor createExecutor(int threadPoolSize, int threadPriority,
QueueProcessingType tasksProcessingType) {
boolean lifo = tasksProcessingType == QueueProcessingType.LIFO;
BlockingQueue<Runnable> taskQueue =
lifo ? new LIFOLinkedBlockingDeque<Runnable>() : new LinkedBlockingQueue<Runnable>();
return new ThreadPoolExecutor(threadPoolSize, threadPoolSize, 0L, TimeUnit.MILLISECONDS, taskQueue,
createThreadFactory(threadPriority, "uil-pool-"));
}
示例2: createExecutor
public static Executor createExecutor(int threadPoolSize, int threadPriority,
QueueProcessingType tasksProcessingType) {
return new ThreadPoolExecutor(threadPoolSize, threadPoolSize, 0, TimeUnit.MILLISECONDS,
tasksProcessingType == QueueProcessingType.LIFO ? new LIFOLinkedBlockingDeque() :
new LinkedBlockingQueue(), createThreadFactory(threadPriority,
"uil-pool-"));
}
示例3: createExecutor
/**
* Creates default implementation of task executor
* 任務執行者的構造方法,當前用於實現默認的task executor
*/
public static Executor createExecutor(int threadPoolSize, int threadPriority,
QueueProcessingType tasksProcessingType) {
//初始化隊列算法類型 默認為LIFO
boolean lifo = tasksProcessingType == QueueProcessingType.LIFO;
//初始化隊列 根據不同的算法類型,創建不同的隊列
BlockingQueue<Runnable> taskQueue =
lifo ? new LIFOLinkedBlockingDeque<Runnable>() : new LinkedBlockingQueue<Runnable>();
return new ThreadPoolExecutor(threadPoolSize, threadPoolSize, 0L, TimeUnit.MILLISECONDS, taskQueue,
createThreadFactory(threadPriority, "uil-pool-"));
}
開發者ID:jiangqqlmj,項目名稱:Android-Universal-Image-Loader-Modify,代碼行數:14,代碼來源:DefaultConfigurationFactory.java
示例4: createExecutor
public static Executor createExecutor(int threadPoolSize, int threadPriority, QueueProcessingType tasksProcessingType) {
return new ThreadPoolExecutor(threadPoolSize, threadPoolSize, 0, TimeUnit.MILLISECONDS, tasksProcessingType == QueueProcessingType.LIFO ? new LIFOLinkedBlockingDeque() : new LinkedBlockingQueue(), createThreadFactory(threadPriority, "uil-pool-"));
}
示例5: createExecutor
/** Creates default implementation of task executor */
public static Executor createExecutor(int threadPoolSize, int threadPriority, QueueProcessingType tasksProcessingType) {
boolean lifo = tasksProcessingType == QueueProcessingType.LIFO;
BlockingQueue<Runnable> taskQueue = lifo ? new LIFOLinkedBlockingDeque<Runnable>() : new LinkedBlockingQueue<Runnable>();
return new ThreadPoolExecutor(threadPoolSize, threadPoolSize, 0L, TimeUnit.MILLISECONDS, taskQueue, createThreadFactory(threadPriority));
}
示例6: createTaskExecutor
private ExecutorService createTaskExecutor() {
boolean lifo = configuration.tasksProcessingType == QueueProcessingType.LIFO;
BlockingQueue<Runnable> taskQueue = lifo ? new LIFOLinkedBlockingDeque<Runnable>() : new LinkedBlockingQueue<Runnable>();
return new ThreadPoolExecutor(configuration.threadPoolSize, configuration.threadPoolSize, 0L, TimeUnit.MILLISECONDS, taskQueue,
DefaultConfigurationFactory.createThreadFactory(configuration.threadPriority));
}