当前位置: 首页>>代码示例>>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;未经允许,请勿转载。