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


Java CacheKeyFilter.accept方法代码示例

本文整理汇总了Java中lucee.commons.io.cache.CacheKeyFilter.accept方法的典型用法代码示例。如果您正苦于以下问题:Java CacheKeyFilter.accept方法的具体用法?Java CacheKeyFilter.accept怎么用?Java CacheKeyFilter.accept使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lucee.commons.io.cache.CacheKeyFilter的用法示例。


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

示例1: remove

import lucee.commons.io.cache.CacheKeyFilter; //导入方法依赖的package包/类
@Override
public int remove(CacheKeyFilter filter) {
	DBCursor cur = qAll_Keys();
	int counter = 0;

	while (cur.hasNext()) {
		DBObject obj = cur.next();
		String key = (String) obj.get("key");
		if (filter.accept(key)) {
			doDelete((BasicDBObject) obj);
			counter++;
		}
	}

	return counter;
}
 
开发者ID:lucee,项目名称:extension-mongodb,代码行数:17,代码来源:MongoDBCache.java

示例2: values

import lucee.commons.io.cache.CacheKeyFilter; //导入方法依赖的package包/类
@Override
public List<Object> values(CacheKeyFilter filter) {
	DBCursor cur = qAll_Keys_Values();
	List<Object> result = new ArrayList<Object>();

	while (cur.hasNext()) {
		BasicDBObject obj = (BasicDBObject) cur.next();
		MongoDBCacheDocument doc = new MongoDBCacheDocument(obj);

		if (filter.accept(doc.getKey())) {
			try {
				result.add(MongoDBCacheDocument.getValue(obj));
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}

	}

	return result;
}
 
开发者ID:lucee,项目名称:extension-mongodb,代码行数:22,代码来源:MongoDBCache.java

示例3: remove

import lucee.commons.io.cache.CacheKeyFilter; //导入方法依赖的package包/类
@Override
public int remove(CacheKeyFilter filter) throws IOException {
	if(CacheUtil.allowAll(filter)) return clear();
	
	
	List<String> keys = keys();
	int count=0;
	Iterator<String> it = keys.iterator();
	String key;
	while(it.hasNext()){
		key=it.next();
		if(filter==null || filter.accept(key)){
			remove(key);
			count++;
		}
	}
	return count;
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:19,代码来源:CacheSupport.java

示例4: remove

import lucee.commons.io.cache.CacheKeyFilter; //导入方法依赖的package包/类
@Override
public int remove(CacheKeyFilter filter) throws IOException {
	if(CacheUtil.allowAll(filter)) return clear();

	List<String> keys = keys();
	int count=0;
	Iterator<String> it = keys.iterator();
	String key;
	while(it.hasNext()){
		key=it.next();
		if(filter==null || filter.accept(key)){
			remove(key);
			count++;
		}
	}
	return count;
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:18,代码来源:CacheSupport.java

示例5: entries

import lucee.commons.io.cache.CacheKeyFilter; //导入方法依赖的package包/类
@Override
public List<CacheEntry> entries(CacheKeyFilter filter) {
	List<CacheEntry> result = new ArrayList<CacheEntry>();
	DBCursor cur = qAll();

	while (cur.hasNext()) {
		BasicDBObject obj = (BasicDBObject) cur.next();
		MongoDBCacheDocument doc = new MongoDBCacheDocument(obj);
		if (filter.accept(doc.getKey())) {
			result.add(new MongoDBCacheEntry(doc));
		}
	}
	return result;
}
 
开发者ID:lucee,项目名称:extension-mongodb,代码行数:15,代码来源:MongoDBCache.java

示例6: keys

import lucee.commons.io.cache.CacheKeyFilter; //导入方法依赖的package包/类
@Override
public List<String> keys(CacheKeyFilter filter) {
	List<String> result = new ArrayList<String>();
	DBCursor cur = qAll_Keys();

	if (cur.count() > 0) {
		while (cur.hasNext()) {
			String key = new MongoDBCacheDocument((BasicDBObject) cur.next()).getKey();
			if (filter.accept(key)) {
				result.add(key);
			}
		}
	}
	return result;
}
 
开发者ID:lucee,项目名称:extension-mongodb,代码行数:16,代码来源:MongoDBCache.java

示例7: entries

import lucee.commons.io.cache.CacheKeyFilter; //导入方法依赖的package包/类
@Override
public List<CacheEntry> entries(CacheKeyFilter filter) throws IOException {
	List<String> keys = keys();
	List<CacheEntry> list=new ArrayList<CacheEntry>();
	Iterator<String> it = keys.iterator();
	String key;
	while(it.hasNext()){
		key=it.next();
		if(filter.accept(key))list.add(getQuiet(key,null));
	}
	return list;
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:13,代码来源:CacheSupport.java

示例8: values

import lucee.commons.io.cache.CacheKeyFilter; //导入方法依赖的package包/类
@Override
public List values(CacheKeyFilter filter) throws IOException {
	if(CacheUtil.allowAll(filter)) return values();
	
	List<String> keys = keys();
	List<Object> list=new ArrayList<Object>();
	Iterator<String> it = keys.iterator();
	String key;
	while(it.hasNext()){
		key=it.next();
		if(filter.accept(key))list.add(getQuiet(key,null).getValue());
	}
	return list;
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:15,代码来源:CacheSupport.java

示例9: values

import lucee.commons.io.cache.CacheKeyFilter; //导入方法依赖的package包/类
@Override
public List values(CacheKeyFilter filter) throws IOException {
	if(CacheUtil.allowAll(filter)) return values();

	List<String> keys = keys();
	List<Object> list=new ArrayList<Object>();
	Iterator<String> it = keys.iterator();
	String key;
	while(it.hasNext()){
		key=it.next();
		if(filter.accept(key))list.add(getQuiet(key,null).getValue());
	}
	return list;
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:15,代码来源:CacheSupport.java


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