本文整理汇总了Java中org.apache.tinkerpop.gremlin.process.traversal.SackFunctions类的典型用法代码示例。如果您正苦于以下问题:Java SackFunctions类的具体用法?Java SackFunctions怎么用?Java SackFunctions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SackFunctions类属于org.apache.tinkerpop.gremlin.process.traversal包,在下文中一共展示了SackFunctions类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldHaveCoreImports
import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions; //导入依赖的package包/类
@Test
public void shouldHaveCoreImports() throws Exception {
final ScriptEngine engine = new DefaultGremlinScriptEngineManager().getEngineByName("gremlin-jython");
assertThat(engine.eval("Graph"), instanceOf(Class.class));
assertThat(engine.eval("__"), instanceOf(Class.class));
assertThat(engine.eval("T"), instanceOf(Class.class));
assertThat(engine.eval("label"), instanceOf(T.class));
assertThat(engine.eval("T.label"), instanceOf(T.class));
assertEquals(SackFunctions.Barrier.class, engine.eval("Barrier"));
assertEquals(SackFunctions.Barrier.normSack, engine.eval("Barrier.normSack"));
assertEquals(Column.class, engine.eval("Column"));
assertEquals(Column.values, engine.eval("Column.valueOf(\'values\')"));
assertEquals(VertexProperty.Cardinality.class, engine.eval("Cardinality"));
assertEquals(VertexProperty.Cardinality.single, engine.eval("Cardinality.valueOf(\'single\')"));
assertTrue(engine.eval("out()") instanceof GraphTraversal);
assertTrue(engine.eval("__.out()") instanceof GraphTraversal);
assertTrue(engine.eval("__.property(VertexProperty.Cardinality.single, 'name','marko')") instanceof GraphTraversal);
assertTrue(engine.eval("__.property(Cardinality.single, 'name','marko')") instanceof GraphTraversal);
}
示例2: loadModern
import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions; //导入依赖的package包/类
@Test
public void g_withBulkXfalseX_withSackX1_sumX_VX1X_localXoutEXknowsX_barrierXnormSackX_inVX_inXknowsX_barrier_sack() {
loadModern();
final Traversal<Vertex, Double> traversal = this.sqlgGraph.traversal()
.withBulk(false)
.withSack(1.0d, Operator.sum)
.V(convertToVertexId("marko"))
.local(
__.outE("knows").barrier(SackFunctions.Barrier.normSack).inV()
)
.in("knows")
.barrier()
.sack();
printTraversalForm(traversal);
checkResults(Collections.singletonList(1.0d), traversal);
}
示例3: shouldReadWriteBarrier
import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions; //导入依赖的package包/类
@Test
public void shouldReadWriteBarrier() throws Exception {
final String resourceName = "barrier";
assumeCompatibility(resourceName);
final SackFunctions.Barrier resource = findModelEntryObject(resourceName);
final SackFunctions.Barrier fromStatic = read(getCompatibility().readFromResource(resourceName), SackFunctions.Barrier.class);
final SackFunctions.Barrier recycled = read(write(fromStatic, SackFunctions.Barrier.class), SackFunctions.Barrier.class);
assertEquals(fromStatic, recycled);
assertEquals(resource, fromStatic);
assertEquals(resource, recycled);
}
示例4: g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack
import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions; //导入依赖的package包/类
@Test
public void g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack() {
loadModern();
final Traversal<Vertex, Double> traversal = this.sqlgGraph.traversal()
.withSack(1.0d, Operator.sum)
.V(convertToVertexId("marko"))
.local(
__.out("knows").barrier(SackFunctions.Barrier.normSack)
)
.in("knows")
.barrier()
.sack();
printTraversalForm(traversal);
checkResults(Arrays.asList(1.0d, 1.0d), traversal);
}
示例5: get_g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack
import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions; //导入依赖的package包/类
@Override
public Traversal<Vertex, Double> get_g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack(final Object v1Id) {
return g.withSack(1.0d, Operator.sum).V(v1Id).local(out("knows").barrier(SackFunctions.Barrier.normSack)).in("knows").barrier().sack();
}
示例6:
import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions; //导入依赖的package包/类
@Override
public Traversal<Vertex, BigDecimal> get_g_withSackXBigInteger_TEN_powX1000X_assignX_V_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack() {
return g.withSack(BigInteger.TEN.pow(1000), Operator.assign).V().local(out("knows").barrier(SackFunctions.Barrier.normSack)).in("knows").barrier().sack();
}
示例7: getClassFromObject
import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions; //导入依赖的package包/类
@Override
protected Class getClassFromObject(final Object o) {
final Class c = o.getClass();
if (classMap.containsKey(c))
return classMap.get(c);
final Class mapped;
if (Map.class.isAssignableFrom(c))
mapped = Map.class;
else if (List.class.isAssignableFrom(c))
mapped = List.class;
else if (Set.class.isAssignableFrom(c))
mapped = Set.class;
else if (Vertex.class.isAssignableFrom(c))
mapped = Vertex.class;
else if (Edge.class.isAssignableFrom(c))
mapped = Edge.class;
else if (Path.class.isAssignableFrom(c))
mapped = Path.class;
else if (VertexProperty.class.isAssignableFrom(c))
mapped = VertexProperty.class;
else if (Metrics.class.isAssignableFrom(c))
mapped = Metrics.class;
else if (TraversalMetrics.class.isAssignableFrom(c))
mapped = TraversalMetrics.class;
else if (Property.class.isAssignableFrom(c))
mapped = Property.class;
else if (ByteBuffer.class.isAssignableFrom(c))
mapped = ByteBuffer.class;
else if (InetAddress.class.isAssignableFrom(c))
mapped = InetAddress.class;
else if (Traverser.class.isAssignableFrom(c))
mapped = Traverser.class;
else if (Lambda.class.isAssignableFrom(c))
mapped = Lambda.class;
else if (VertexProperty.Cardinality.class.isAssignableFrom(c))
mapped = VertexProperty.Cardinality.class;
else if (Column.class.isAssignableFrom(c))
mapped = Column.class;
else if (Direction.class.isAssignableFrom(c))
mapped = Direction.class;
else if (Operator.class.isAssignableFrom(c))
mapped = Operator.class;
else if (Order.class.isAssignableFrom(c))
mapped = Order.class;
else if (Pop.class.isAssignableFrom(c))
mapped = Pop.class;
else if (SackFunctions.Barrier.class.isAssignableFrom(c))
mapped = SackFunctions.Barrier.class;
else if (TraversalOptionParent.Pick.class.isAssignableFrom(c))
mapped = TraversalOptionParent.Pick.class;
else if (Scope.class.isAssignableFrom(c))
mapped = Scope.class;
else if (T.class.isAssignableFrom(c))
mapped = T.class;
else
mapped = c;
classMap.put(c, mapped);
return mapped;
}
示例8: getClassFromObject
import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions; //导入依赖的package包/类
@Override
protected Class getClassFromObject(final Object o) {
final Class c = o.getClass();
if (classMap.containsKey(c))
return classMap.get(c);
final Class mapped;
if (Vertex.class.isAssignableFrom(c))
mapped = Vertex.class;
else if (Edge.class.isAssignableFrom(c))
mapped = Edge.class;
else if (Path.class.isAssignableFrom(c))
mapped = Path.class;
else if (VertexProperty.class.isAssignableFrom(c))
mapped = VertexProperty.class;
else if (Metrics.class.isAssignableFrom(c))
mapped = Metrics.class;
else if (TraversalMetrics.class.isAssignableFrom(c))
mapped = TraversalMetrics.class;
else if (Property.class.isAssignableFrom(c))
mapped = Property.class;
else if (ByteBuffer.class.isAssignableFrom(c))
mapped = ByteBuffer.class;
else if (InetAddress.class.isAssignableFrom(c))
mapped = InetAddress.class;
else if (Traverser.class.isAssignableFrom(c))
mapped = Traverser.class;
else if (Lambda.class.isAssignableFrom(c))
mapped = Lambda.class;
else if (VertexProperty.Cardinality.class.isAssignableFrom(c))
mapped = VertexProperty.Cardinality.class;
else if (Column.class.isAssignableFrom(c))
mapped = Column.class;
else if (Direction.class.isAssignableFrom(c))
mapped = Direction.class;
else if (Operator.class.isAssignableFrom(c))
mapped = Operator.class;
else if (Order.class.isAssignableFrom(c))
mapped = Order.class;
else if (Pop.class.isAssignableFrom(c))
mapped = Pop.class;
else if (SackFunctions.Barrier.class.isAssignableFrom(c))
mapped = SackFunctions.Barrier.class;
else if (TraversalOptionParent.Pick.class.isAssignableFrom(c))
mapped = TraversalOptionParent.Pick.class;
else if (Scope.class.isAssignableFrom(c))
mapped = Scope.class;
else if (T.class.isAssignableFrom(c))
mapped = T.class;
else
mapped = c;
classMap.put(c, mapped);
return mapped;
}