本文整理汇总了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));
}
示例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);
}
}
示例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;
}
示例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;
}