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


Java Compare.eq方法代码示例

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


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

示例1: lookupEdges

import org.apache.tinkerpop.gremlin.process.traversal.Compare; //导入方法依赖的package包/类
private Iterator<Edge> lookupEdges(final Traverser.Admin<Vertex> traverser, final List<HasContainer> hasContainers) {
    final HBaseGraph graph = (HBaseGraph) this.getTraversal().getGraph().get();
    if (getEdgeLabels().length == 1) {
        final String label = getEdgeLabels()[0];
        // find an edge by label and key/value
        for (final HasContainer hasContainer : hasContainers) {
            if (Compare.eq == hasContainer.getBiPredicate() && !hasContainer.getKey().equals(T.label.getAccessor())) {
                if (graph.hasIndex(OperationType.READ, ElementType.EDGE, label, hasContainer.getKey())) {
                    return IteratorUtils.stream(((HBaseVertex) traverser.get()).edges(getDirection(), label, hasContainer.getKey(), hasContainer.getValue()))
                            .filter(vertex -> HasContainer.testAll(vertex, hasContainers)).iterator();
                }
            }
        }
    }

    // linear scan
    return CloseableIteratorUtils.filter(traverser.get().edges(getDirection(), getEdgeLabels()),
            edge -> HasContainer.testAll(edge, hasContainers));
}
 
开发者ID:rayokota,项目名称:hgraphdb,代码行数:20,代码来源:HBaseVertexStep.java

示例2: getGremlinPredicate

import org.apache.tinkerpop.gremlin.process.traversal.Compare; //导入方法依赖的package包/类
private Compare getGremlinPredicate(ComparisionOperator op) {
    switch (op) {
        case EQUAL:
            return Compare.eq;
        case GREATER_THAN:
            return Compare.gt;
        case GREATER_THAN_EQUAL:
            return Compare.gte;
        case LESS_THAN:
            return Compare.lt;
        case LESS_THAN_EQUAL:
            return Compare.lte;
        case NOT_EQUAL:
            return Compare.neq;

        default:
            throw new RuntimeException("Unsupported comparison operator:" + op);
    }
}
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:20,代码来源:NativeTitan1GraphQuery.java

示例3: processHasContainerIds

import org.apache.tinkerpop.gremlin.process.traversal.Compare; //导入方法依赖的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: processHasContainerIds

import org.apache.tinkerpop.gremlin.process.traversal.Compare; //导入方法依赖的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


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