當前位置: 首頁>>代碼示例>>Java>>正文


Java QueueProcessingType.LIFO屬性代碼示例

本文整理匯總了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-"));
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:9,代碼來源:DefaultConfigurationFactory.java

示例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-"));
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:7,代碼來源:DefaultConfigurationFactory.java

示例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-"));
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:3,代碼來源:DefaultConfigurationFactory.java

示例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));
}
 
開發者ID:Apokrif,項目名稱:morse,代碼行數:6,代碼來源:DefaultConfigurationFactory.java

示例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));
}
 
開發者ID:jixieshi999,項目名稱:juahya,代碼行數:6,代碼來源:ImageLoaderEngine.java


注:本文中的com.nostra13.universalimageloader.core.assist.QueueProcessingType.LIFO屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。