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


Java Has类代码示例

本文整理汇总了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);
}
 
开发者ID:cr0wbar,项目名称:Bananarama,代码行数:18,代码来源:CQE2SQL.java

示例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);
    }
}
 
开发者ID:npgall,项目名称:cqengine,代码行数:24,代码来源:HashIndex.java

示例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;
}
 
开发者ID:eventsourcing,项目名称:es4j,代码行数:8,代码来源:PostgreSQLAttributeIndex.java

示例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();
}
 
开发者ID:eventsourcing,项目名称:es4j,代码行数:20,代码来源:EqualityIndex.java

示例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());
}
 
开发者ID:cr0wbar,项目名称:Bananarama,代码行数:8,代码来源:HasMapper.java

示例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);
    }});
}
 
开发者ID:npgall,项目名称:cqengine,代码行数:16,代码来源:HashIndex.java


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