本文整理汇总了Java中com.googlecode.cqengine.query.simple.Has类的典型用法代码示例。如果您正苦于以下问题:Java Has类的具体用法?Java Has怎么用?Java Has使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Has类属于com.googlecode.cqengine.query.simple包,在下文中一共展示了Has类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMappers
import com.googlecode.cqengine.query.simple.Has; //导入依赖的package包/类
private static Map<Class<? extends Query>, Mapper> getMappers(){
HashMap<Class<? extends Query>,Mapper> map = new HashMap<>();
//Simple
map.put(Equal.class,new EqualMapper());
map.put(GreaterThan.class,new GreaterThanMapper());
map.put(LessThan.class,new LessThanMapper());
map.put(Between.class,new BetweenMapper());
map.put(Has.class,new HasMapper());
//Logical
map.put(And.class,new AndMapper());
map.put(Or.class,new OrMapper());
map.put(Not.class,new NotMapper());
return Collections.unmodifiableMap(map);
}
示例2: retrieve
import com.googlecode.cqengine.query.simple.Has; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public ResultSet<O> retrieve(final Query<O> query, final QueryOptions queryOptions) {
Class<?> queryClass = query.getClass();
if (queryClass.equals(Equal.class)) {
@SuppressWarnings("unchecked")
Equal<O, A> equal = (Equal<O, A>) query;
return retrieveEqual(equal, queryOptions);
}
else if (queryClass.equals(In.class)) {
@SuppressWarnings("unchecked")
In<O, A> in = (In<O, A>) query;
return retrieveIn(in, queryOptions);
}
else if (queryClass.equals(Has.class)) {
return deduplicateIfNecessary(indexMap.values(), query, getAttribute(), queryOptions, INDEX_RETRIEVAL_COST);
}
else {
throw new IllegalArgumentException("Unsupported query: " + query);
}
}
示例3: HasResultSet
import com.googlecode.cqengine.query.simple.Has; //导入依赖的package包/类
public HasResultSet(PostgreSQLStatementIterator<EntityHandle<O>> iterator, Has<EntityHandle<O>, A> has,
QueryOptions queryOptions, int finalSize) {
this.iterator = iterator;
this.has = has;
this.queryOptions = queryOptions;
this.finalSize = finalSize;
}
示例4: EqualityIndex
import com.googlecode.cqengine.query.simple.Has; //导入依赖的package包/类
@SneakyThrows
protected EqualityIndex(DataSource dataSource, Attribute<O, A> attribute, boolean unique) {
super(attribute, new HashSet<Class<? extends Query>>() {{
add(Equal.class);
add(Has.class);
}});
this.dataSource = dataSource;
this.unique = unique;
layout = Layout.forClass(attribute.getEffectiveObjectType());
TypeResolver typeResolver = new TypeResolver();
ResolvedType resolvedType;
if (attribute instanceof ReflectableAttribute) {
resolvedType = typeResolver.resolve(((ReflectableAttribute) attribute).getAttributeReflectedType());
} else {
resolvedType = typeResolver.resolve(attribute.getAttributeType());
}
attributeTypeHandler = TypeHandler.lookup(resolvedType);
init();
}
示例5: map
import com.googlecode.cqengine.query.simple.Has; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public String map(Has q) {
return String.format("%s is not null",q.getAttributeName());
}
示例6: HashIndex
import com.googlecode.cqengine.query.simple.Has; //导入依赖的package包/类
/**
* Package-private constructor, used by static factory methods. Creates a new HashIndex initialized to index the
* supplied attribute.
*
* @param indexMapFactory A factory used to create the main map-based data structure used by the index
* @param valueSetFactory A factory used to create sets to store values in the index
* @param attribute The attribute on which the index will be built
*/
protected HashIndex(Factory<ConcurrentMap<A, StoredResultSet<O>>> indexMapFactory, Factory<StoredResultSet<O>> valueSetFactory, Attribute<O, A> attribute) {
super(indexMapFactory, valueSetFactory, attribute, new HashSet<Class<? extends Query>>() {{
add(Equal.class);
add(In.class);
add(Has.class);
}});
}