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


Java Contains.within方法代码示例

本文整理汇总了Java中org.apache.tinkerpop.gremlin.process.traversal.Contains.within方法的典型用法代码示例。如果您正苦于以下问题:Java Contains.within方法的具体用法?Java Contains.within怎么用?Java Contains.within使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.tinkerpop.gremlin.process.traversal.Contains的用法示例。


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

示例1: getContainsCondition

import org.apache.tinkerpop.gremlin.process.traversal.Contains; //导入方法依赖的package包/类
private Condition getContainsCondition(Object value, BiPredicate<?, ?> biPredicate, Field<Object> field) {
    if (biPredicate == Contains.without) {
        if (value == null) {
            return field.isNull();
        } else {
            return field.notIn(value);
        }
    } else if (biPredicate == Contains.within) {
        if (value == null) {
            return field.isNotNull();
        } else {
            return field.in(((Collection) value).toArray());
        }
    }
    return null;
}
 
开发者ID:unipop-graph,项目名称:unipop,代码行数:17,代码来源:JdbcPredicatesTranslator.java

示例2: addIdHasContainers

import org.apache.tinkerpop.gremlin.process.traversal.Contains; //导入方法依赖的package包/类
private void addIdHasContainers(SchemaTableTree schemaTableTree1, List<Multimap<BiPredicate, RecordId>> biPredicateRecordIds) {
    if (biPredicateRecordIds != null) {
        for (Multimap<BiPredicate, RecordId> biPredicateRecordId : biPredicateRecordIds) {
            for (BiPredicate biPredicate : biPredicateRecordId.keySet()) {
                Collection<RecordId> recordIds = biPredicateRecordId.get(biPredicate);
                HasContainer idHasContainer;
                //id hasContainers are only optimized for BaseStrategy.SUPPORTED_ID_BI_PREDICATE within, without, eq, neq
                if (biPredicate == Contains.without || biPredicate == Contains.within) {
                    idHasContainer = new HasContainer(T.id.getAccessor(), P.test(biPredicate, recordIds));
                    schemaTableTree1.getHasContainers().add(idHasContainer);
                } else {
                    Preconditions.checkState(biPredicate == Compare.eq || biPredicate == Compare.neq);
                    for (RecordId recordId : recordIds) {
                        idHasContainer = new HasContainer(T.id.getAccessor(), P.test(biPredicate, recordId));
                        schemaTableTree1.getHasContainers().add(idHasContainer);
                    }
                }
            }
        }
    }
}
 
开发者ID:pietermartin,项目名称:sqlg,代码行数:22,代码来源:ReplacedStep.java

示例3: processHasContainerIds

import org.apache.tinkerpop.gremlin.process.traversal.Contains; //导入方法依赖的package包/类
/**
 * Helper method for providers that want to "fold in" {@link HasContainer}'s based on id checking into the ids of the {@link GraphStep}.
 *
 * @param graphStep    the GraphStep to potentially {@link GraphStep#addIds(Object...)}.
 * @param hasContainer The {@link HasContainer} to check for id validation.
 * @return true if the {@link HasContainer} updated ids and thus, was processed.
 */
public static boolean processHasContainerIds(final GraphStep<?, ?> graphStep, final HasContainer hasContainer) {
    if (hasContainer.getKey().equals(T.id.getAccessor()) && (hasContainer.getBiPredicate() == Compare.eq || hasContainer.getBiPredicate() == Contains.within)) {
        graphStep.addIds(hasContainer.getValue());
        return true;
    }
    return false;
}
 
开发者ID:PKUSilvester,项目名称:LiteGraph,代码行数:15,代码来源:GraphStep.java

示例4: getContainsFilter

import org.apache.tinkerpop.gremlin.process.traversal.Contains; //导入方法依赖的package包/类
private static QueryBuilder getContainsFilter(String key, Object value, BiPredicate<?, ?> biPredicate) {
    if (biPredicate == Contains.without) return QueryBuilders.boolQuery().mustNot(QueryBuilders.existsQuery(key));
    else if (biPredicate == Contains.within) {
        if (value == null) return QueryBuilders.existsQuery(key);
        else if (value instanceof Collection<?>)
            return QueryBuilders.termsQuery(key, (Collection<?>) value);
        else if (value.getClass().isArray())
            return QueryBuilders.termsQuery(key, (Object[]) value);
        else return QueryBuilders.termsQuery(key, value);
    } else throw new IllegalArgumentException("predicate not supported by unipop: " + biPredicate.toString());
}
 
开发者ID:unipop-graph,项目名称:unipop,代码行数:12,代码来源:FilterHelper.java

示例5: processHasContainerIds

import org.apache.tinkerpop.gremlin.process.traversal.Contains; //导入方法依赖的package包/类
/**
 * Helper method for providers that want to "fold in" {@link HasContainer}'s based on id checking into the ids of the {@link GraphStep}.
 *
 * @param graphStep    the GraphStep to potentially {@link GraphStep#addIds(Object...)}.
 * @param hasContainer The {@link HasContainer} to check for id validation.
 * @return true if the {@link HasContainer} updated ids and thus, was processed.
 */
public static boolean processHasContainerIds(final GraphStep<?, ?> graphStep, final HasContainer hasContainer) {
    if (hasContainer.getKey().equals(T.id.getAccessor()) && graphStep.ids.length == 0 &&
            (hasContainer.getBiPredicate() == Compare.eq || hasContainer.getBiPredicate() == Contains.within)) {
        graphStep.addIds(hasContainer.getValue());
        return true;
    }
    return false;
}
 
开发者ID:apache,项目名称:tinkerpop,代码行数:16,代码来源:GraphStep.java

示例6: getValueIterator

import org.apache.tinkerpop.gremlin.process.traversal.Contains; //导入方法依赖的package包/类
/**
 * gets the requested values from the Has step. If it's a single value, wrap it in an array, otherwise return the array
 */
private Iterator<Object> getValueIterator(HasContainer c) {
    return c.getPredicate().getBiPredicate() == Contains.within
            ? ((Iterable<Object>) c.getValue()).iterator()
            : IteratorUtils.of(c.getValue());
}
 
开发者ID:orientechnologies,项目名称:orientdb-gremlin,代码行数:9,代码来源:OrientGraphStep.java

示例7: collectSchemaTableTrees

import org.apache.tinkerpop.gremlin.process.traversal.Contains; //导入方法依赖的package包/类
private void collectSchemaTableTrees(
        SqlgGraph sqlgGraph,
        int replacedStepDepth,
        Set<SchemaTableTree> result,
        Map<SchemaTable, List<Multimap<BiPredicate, RecordId>>> groupedIds,
        String table) {

    SchemaTable schemaTable = SchemaTable.from(sqlgGraph, table);

    List<HasContainer> schemaTableTreeHasContainers = new ArrayList<>(this.hasContainers);

    if (groupedIds != null) {
        List<Multimap<BiPredicate, RecordId>> biPredicateRecordIds = groupedIds.get(schemaTable.withOutPrefix());
        if (biPredicateRecordIds != null) {
            for (Multimap<BiPredicate, RecordId> biPredicateRecordId : biPredicateRecordIds) {
                for (BiPredicate biPredicate : biPredicateRecordId.keySet()) {
                    Collection<RecordId> recordIds = biPredicateRecordId.get(biPredicate);
                    HasContainer idHasContainer;
                    //id hasContainers are only optimized for BaseStrategy.SUPPORTED_ID_BI_PREDICATE within, without, eq, neq
                    if (biPredicate == Contains.without || biPredicate == Contains.within) {
                        idHasContainer = new HasContainer(T.id.getAccessor(), P.test(biPredicate, recordIds));
                        schemaTableTreeHasContainers.add(idHasContainer);
                    } else {
                        Preconditions.checkState(biPredicate == Compare.eq || biPredicate == Compare.neq);
                        for (RecordId recordId : recordIds) {
                            idHasContainer = new HasContainer(T.id.getAccessor(), P.test(biPredicate, recordId));
                            schemaTableTreeHasContainers.add(idHasContainer);
                        }
                    }
                }
            }
        }
    }
    SchemaTableTree schemaTableTree = new SchemaTableTree(
            sqlgGraph,
            schemaTable,
            0,
            schemaTableTreeHasContainers,
            this.andOrHasContainers,
            this.sqlgComparatorHolder,
            this.sqlgComparatorHolder.getComparators(),
            this.sqlgRangeHolder,
            SchemaTableTree.STEP_TYPE.GRAPH_STEP,
            ReplacedStep.this.emit,
            ReplacedStep.this.untilFirst,
            ReplacedStep.this.leftJoin,
            ReplacedStep.this.drop,
            replacedStepDepth,
            ReplacedStep.this.labels
    );

    result.add(schemaTableTree);
}
 
开发者ID:pietermartin,项目名称:sqlg,代码行数:54,代码来源:ReplacedStep.java

示例8: isBulkWithinAndOut

import org.apache.tinkerpop.gremlin.process.traversal.Contains; //导入方法依赖的package包/类
public static boolean isBulkWithinAndOut(SqlgGraph sqlgGraph, HasContainer hasContainer) {
    BiPredicate p = hasContainer.getPredicate().getBiPredicate();
    return (p == Contains.within || p == Contains.without) && ((Collection) hasContainer.getPredicate().getValue()).size() > sqlgGraph.configuration().getInt("bulk.within.count", BULK_WITHIN_COUNT);
}
 
开发者ID:pietermartin,项目名称:sqlg,代码行数:5,代码来源:SqlgUtil.java

示例9: isBulkWithin

import org.apache.tinkerpop.gremlin.process.traversal.Contains; //导入方法依赖的package包/类
public static boolean isBulkWithin(SqlgGraph sqlgGraph, HasContainer hasContainer) {
    BiPredicate p = hasContainer.getPredicate().getBiPredicate();
    return p == Contains.within && ((Collection) hasContainer.getPredicate().getValue()).size() > sqlgGraph.configuration().getInt("bulk.within.count", BULK_WITHIN_COUNT);
}
 
开发者ID:pietermartin,项目名称:sqlg,代码行数:5,代码来源:SqlgUtil.java


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