From 1b13f052629170097e303680e1a0da5fd9e2bfac Mon Sep 17 00:00:00 2001 From: florianhockmann Date: Fri, 12 Jan 2018 18:13:45 +0100 Subject: [PATCH 1/3] Add GraphTraversalSource.Inject TINKERPOP-1868 --- gremlin-dotnet/glv/GraphTraversalSource.template | 4 ++-- gremlin-dotnet/glv/generate.groovy | 13 +++++++++---- .../Process/Traversal/GraphTraversalSource.cs | 13 +++++++++++++ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/gremlin-dotnet/glv/GraphTraversalSource.template b/gremlin-dotnet/glv/GraphTraversalSource.template index b99397c8ed8..f14f2ae45c1 100644 --- a/gremlin-dotnet/glv/GraphTraversalSource.template +++ b/gremlin-dotnet/glv/GraphTraversalSource.template @@ -127,9 +127,9 @@ namespace Gremlin.Net.Process.Traversal /// Spawns a off this graph traversal source and adds the <%= method.methodName %> step to that /// traversal. /// - public GraphTraversal< <%= method.typeArguments.join(",") %> > <%= toCSharpMethodName.call(method.methodName) %>(<%= method.parameters %>) + public GraphTraversal< <%= method.typeNames.join(",") %> > <%= toCSharpMethodName.call(method.methodName) %><%= method.tParam %>(<%= method.parameters %>) { - var traversal = new GraphTraversal< <%= method.typeArguments.join(",") %> >(TraversalStrategies, new Bytecode(Bytecode)); + var traversal = new GraphTraversal< <%= method.typeNames.join(",") %> >(TraversalStrategies, new Bytecode(Bytecode)); <% if (method.parameters.contains("params ")) { %>var args = new List(<%= method.paramNames.init().size() %> + <%= method.paramNames.last() %>.Length) {<%= method.paramNames.init().join(", ") %>}; args.AddRange(<%= method.paramNames.last() %>); diff --git a/gremlin-dotnet/glv/generate.groovy b/gremlin-dotnet/glv/generate.groovy index 52ca165ce1c..ecbea46735f 100644 --- a/gremlin-dotnet/glv/generate.groovy +++ b/gremlin-dotnet/glv/generate.groovy @@ -81,6 +81,9 @@ def getCSharpGenericTypeParam = { typeName -> else if (typeName.contains(" a.name <=> b.name ?: getJavaParamTypeString(a) <=> getJavaParamTypeString(b) }. unique { a,b -> a.name <=> b.name ?: getCSharpParamTypeString(a) <=> getCSharpParamTypeString(b) }. collect { javaMethod -> - def typeArguments = javaMethod.genericReturnType.actualTypeArguments.collect{t -> ((java.lang.Class)t).simpleName} - def parameters = getCSharpParamString(javaMethod, false) + def typeNames = getJavaGenericTypeParameterTypeNames(javaMethod) + def t2 = toCSharpType(typeNames[1]) + def tParam = getCSharpGenericTypeParam(t2) + def parameters = getCSharpParamString(javaMethod, true) def paramNames = getParamNames(javaMethod.parameters) - return ["methodName": javaMethod.name, "typeArguments": typeArguments, "parameters":parameters, "paramNames":paramNames] + return ["methodName": javaMethod.name, "typeNames": typeNames, "tParam":tParam, "parameters":parameters, "paramNames":paramNames] }, "graphStepMethods": GraphTraversal.getMethods(). findAll { GraphTraversal.class.equals(it.returnType) }. diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs index 36fde7cd40e..c536a78691b 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs @@ -244,6 +244,19 @@ public GraphTraversal< Vertex,Vertex > AddV(string label) return traversal; } + /// + /// Spawns a off this graph traversal source and adds the inject step to that + /// traversal. + /// + public GraphTraversal< S,S > Inject(params object[] starts) + { + var traversal = new GraphTraversal< S,S >(TraversalStrategies, new Bytecode(Bytecode)); + var args = new List(0 + starts.Length) {}; + args.AddRange(starts); + traversal.Bytecode.AddStep("inject", args.ToArray()); + return traversal; + } + } #pragma warning restore 1591 From 944c2c8711db585f1ce17fd382ecfb96c4a87bc3 Mon Sep 17 00:00:00 2001 From: florianhockmann Date: Sat, 13 Jan 2018 19:05:03 +0100 Subject: [PATCH 2/3] Make Injects signature type-safe TINKERPOP-1868 --- gremlin-dotnet/glv/GraphTraversal.template | 2 +- .../glv/GraphTraversalSource.template | 2 +- gremlin-dotnet/glv/generate.groovy | 28 ++++++- .../Process/Traversal/GraphTraversal.cs | 76 +++++++++---------- .../Process/Traversal/GraphTraversalSource.cs | 10 +-- 5 files changed, 71 insertions(+), 47 deletions(-) diff --git a/gremlin-dotnet/glv/GraphTraversal.template b/gremlin-dotnet/glv/GraphTraversal.template index c7c66583e58..810516f3c7c 100644 --- a/gremlin-dotnet/glv/GraphTraversal.template +++ b/gremlin-dotnet/glv/GraphTraversal.template @@ -68,7 +68,7 @@ namespace Gremlin.Net.Process.Traversal public GraphTraversal< <%= method.t1 %> , <%= method.t2 %> > <%= toCSharpMethodName.call(method.methodName) %><%= method.tParam %> (<%= method.parameters %>) { <% if (method.parameters.contains("params ")) { - %> var args = new List(<%= method.paramNames.init().size() %> + <%= method.paramNames.last() %>.Length) {<%= method.paramNames.init().join(", ") %>}; + %> var args = new List< <%= method.argsListType %> >(<%= method.paramNames.init().size() %> + <%= method.paramNames.last() %>.Length) {<%= method.paramNames.init().join(", ") %>}; args.AddRange(<%= method.paramNames.last() %>); Bytecode.AddStep("<%= method.methodName %>", args.ToArray());<% } diff --git a/gremlin-dotnet/glv/GraphTraversalSource.template b/gremlin-dotnet/glv/GraphTraversalSource.template index f14f2ae45c1..f8b0acf1092 100644 --- a/gremlin-dotnet/glv/GraphTraversalSource.template +++ b/gremlin-dotnet/glv/GraphTraversalSource.template @@ -131,7 +131,7 @@ namespace Gremlin.Net.Process.Traversal { var traversal = new GraphTraversal< <%= method.typeNames.join(",") %> >(TraversalStrategies, new Bytecode(Bytecode)); <% if (method.parameters.contains("params ")) { - %>var args = new List(<%= method.paramNames.init().size() %> + <%= method.paramNames.last() %>.Length) {<%= method.paramNames.init().join(", ") %>}; + %>var args = new List< <%= method.argsListType %> >(<%= method.paramNames.init().size() %> + <%= method.paramNames.last() %>.Length) {<%= method.paramNames.init().join(", ") %>}; args.AddRange(<%= method.paramNames.last() %>); traversal.Bytecode.AddStep("<%= method.methodName %>", args.ToArray());<% } diff --git a/gremlin-dotnet/glv/generate.groovy b/gremlin-dotnet/glv/generate.groovy index ecbea46735f..81b2f83fd5e 100644 --- a/gremlin-dotnet/glv/generate.groovy +++ b/gremlin-dotnet/glv/generate.groovy @@ -26,6 +26,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__ import org.apache.tinkerpop.gremlin.structure.Direction import java.lang.reflect.Modifier import java.lang.reflect.TypeVariable +import java.lang.reflect.GenericArrayType def toCSharpTypeMap = ["Long": "long", "Integer": "int", @@ -84,6 +85,9 @@ def getCSharpGenericTypeParam = { typeName -> else if (typeName.contains("S")) { tParam = "" } + else if (typeName.contains("A")) { + tParam = "" + } return tParam } @@ -127,6 +131,9 @@ def toCSharpParamString = { param, genTypeName -> else if (csharpParamTypeName == "M") { csharpParamTypeName = "object"; } + else if (csharpParamTypeName == "A[]") { + csharpParamTypeName = "object[]"; + } else if (csharpParamTypeName == "A" || csharpParamTypeName == "B") { csharpParamTypeName = "E2"; } @@ -159,6 +166,11 @@ def getCSharpParamString = { method, useGenericParams -> if (genType instanceof TypeVariable) { genTypeName = ((TypeVariable)genType).name } + else if (genType instanceof GenericArrayType) { + if (((GenericArrayType)genType).getGenericComponentType() instanceof TypeVariable) { + genTypeName = ((TypeVariable)((GenericArrayType)genType).getGenericComponentType()).name + "[]" + } + } } toCSharpParamString(param, genTypeName) }. @@ -179,6 +191,16 @@ def getParamNames = { parameters -> } } +def getArgsListType = { parameterString -> + def argsListType = "object" + if (parameterString.contains("params ")) { + def paramsType = parameterString.substring(parameterString.indexOf("params ") + "params ".length(), parameterString.indexOf("[]")) + if (paramsType == "E" || paramsType == "S") + argsListType = paramsType + } + argsListType +} + def hasMethodNoGenericCounterPartInGraphTraversal = { method -> def parameterTypeNames = getJavaParameterTypeNames(method) if (method.name.equals("fold")) { @@ -247,7 +269,8 @@ def binding = ["pmethods": P.class.getMethods(). def tParam = getCSharpGenericTypeParam(t2) def parameters = getCSharpParamString(javaMethod, true) def paramNames = getParamNames(javaMethod.parameters) - return ["methodName": javaMethod.name, "typeNames": typeNames, "tParam":tParam, "parameters":parameters, "paramNames":paramNames] + def argsListType = getArgsListType(parameters) + return ["methodName": javaMethod.name, "typeNames": typeNames, "tParam":tParam, "parameters":parameters, "paramNames":paramNames, "argsListType":argsListType] }, "graphStepMethods": GraphTraversal.getMethods(). findAll { GraphTraversal.class.equals(it.returnType) }. @@ -262,7 +285,8 @@ def binding = ["pmethods": P.class.getMethods(). def tParam = getCSharpGenericTypeParam(t2) def parameters = getCSharpParamString(javaMethod, true) def paramNames = getParamNames(javaMethod.parameters) - return ["methodName": javaMethod.name, "t1":t1, "t2":t2, "tParam":tParam, "parameters":parameters, "paramNames":paramNames] + def argsListType = getArgsListType(parameters) + return ["methodName": javaMethod.name, "t1":t1, "t2":t2, "tParam":tParam, "parameters":parameters, "paramNames":paramNames, "argsListType":argsListType] }, "anonStepMethods": __.class.getMethods(). findAll { GraphTraversal.class.equals(it.returnType) }. diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs index e3eb1900c08..ed4b86791d8 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs @@ -67,7 +67,7 @@ private static GraphTraversal Wrap(GraphTraversal traversa /// public GraphTraversal< S , Vertex > V (params object[] vertexIdsOrElements) { - var args = new List(0 + vertexIdsOrElements.Length) {}; + var args = new List< object >(0 + vertexIdsOrElements.Length) {}; args.AddRange(vertexIdsOrElements); Bytecode.AddStep("V", args.ToArray()); return Wrap< S , Vertex >(this); @@ -78,7 +78,7 @@ public GraphTraversal< S , Vertex > V (params object[] vertexIdsOrElements) /// public GraphTraversal< S , Edge > AddE (Direction direction, string firstVertexKeyOrEdgeLabel, string edgeLabelOrSecondVertexKey, params object[] propertyKeyValues) { - var args = new List(3 + propertyKeyValues.Length) {direction, firstVertexKeyOrEdgeLabel, edgeLabelOrSecondVertexKey}; + var args = new List< object >(3 + propertyKeyValues.Length) {direction, firstVertexKeyOrEdgeLabel, edgeLabelOrSecondVertexKey}; args.AddRange(propertyKeyValues); Bytecode.AddStep("addE", args.ToArray()); return Wrap< S , Edge >(this); @@ -98,7 +98,7 @@ public GraphTraversal< S , Edge > AddE (string edgeLabel) /// public GraphTraversal< S , Edge > AddInE (string firstVertexKeyOrEdgeLabel, string edgeLabelOrSecondVertexKey, params object[] propertyKeyValues) { - var args = new List(2 + propertyKeyValues.Length) {firstVertexKeyOrEdgeLabel, edgeLabelOrSecondVertexKey}; + var args = new List< object >(2 + propertyKeyValues.Length) {firstVertexKeyOrEdgeLabel, edgeLabelOrSecondVertexKey}; args.AddRange(propertyKeyValues); Bytecode.AddStep("addInE", args.ToArray()); return Wrap< S , Edge >(this); @@ -109,7 +109,7 @@ public GraphTraversal< S , Edge > AddInE (string firstVertexKeyOrEdgeLabel, stri /// public GraphTraversal< S , Edge > AddOutE (string firstVertexKeyOrEdgeLabel, string edgeLabelOrSecondVertexKey, params object[] propertyKeyValues) { - var args = new List(2 + propertyKeyValues.Length) {firstVertexKeyOrEdgeLabel, edgeLabelOrSecondVertexKey}; + var args = new List< object >(2 + propertyKeyValues.Length) {firstVertexKeyOrEdgeLabel, edgeLabelOrSecondVertexKey}; args.AddRange(propertyKeyValues); Bytecode.AddStep("addOutE", args.ToArray()); return Wrap< S , Edge >(this); @@ -129,7 +129,7 @@ public GraphTraversal< S , Vertex > AddV () /// public GraphTraversal< S , Vertex > AddV (params object[] propertyKeyValues) { - var args = new List(0 + propertyKeyValues.Length) {}; + var args = new List< object >(0 + propertyKeyValues.Length) {}; args.AddRange(propertyKeyValues); Bytecode.AddStep("addV", args.ToArray()); return Wrap< S , Vertex >(this); @@ -158,7 +158,7 @@ public GraphTraversal< S , E > Aggregate (string sideEffectKey) /// public GraphTraversal< S , E > And (params ITraversal[] andTraversals) { - var args = new List(0 + andTraversals.Length) {}; + var args = new List< object >(0 + andTraversals.Length) {}; args.AddRange(andTraversals); Bytecode.AddStep("and", args.ToArray()); return Wrap< S , E >(this); @@ -169,7 +169,7 @@ public GraphTraversal< S , E > And (params ITraversal[] andTraversals) /// public GraphTraversal< S , E > As (string stepLabel, params string[] stepLabels) { - var args = new List(1 + stepLabels.Length) {stepLabel}; + var args = new List< object >(1 + stepLabels.Length) {stepLabel}; args.AddRange(stepLabels); Bytecode.AddStep("as", args.ToArray()); return Wrap< S , E >(this); @@ -207,7 +207,7 @@ public GraphTraversal< S , E > Barrier (int maxBarrierSize) /// public GraphTraversal< S , Vertex > Both (params string[] edgeLabels) { - var args = new List(0 + edgeLabels.Length) {}; + var args = new List< object >(0 + edgeLabels.Length) {}; args.AddRange(edgeLabels); Bytecode.AddStep("both", args.ToArray()); return Wrap< S , Vertex >(this); @@ -218,7 +218,7 @@ public GraphTraversal< S , Vertex > Both (params string[] edgeLabels) /// public GraphTraversal< S , Edge > BothE (params string[] edgeLabels) { - var args = new List(0 + edgeLabels.Length) {}; + var args = new List< object >(0 + edgeLabels.Length) {}; args.AddRange(edgeLabels); Bytecode.AddStep("bothE", args.ToArray()); return Wrap< S , Edge >(this); @@ -337,7 +337,7 @@ public GraphTraversal< S , E > By (ITraversal traversal, object comparator) /// public GraphTraversal< S , E2 > Cap (string sideEffectKey, params string[] sideEffectKeys) { - var args = new List(1 + sideEffectKeys.Length) {sideEffectKey}; + var args = new List< object >(1 + sideEffectKeys.Length) {sideEffectKey}; args.AddRange(sideEffectKeys); Bytecode.AddStep("cap", args.ToArray()); return Wrap< S , E2 >(this); @@ -402,7 +402,7 @@ public GraphTraversal< S , E2 > Choose (ITraversal traversalPredicate, ITrav /// public GraphTraversal< S , E2 > Coalesce (params ITraversal[] coalesceTraversals) { - var args = new List(0 + coalesceTraversals.Length) {}; + var args = new List< object >(0 + coalesceTraversals.Length) {}; args.AddRange(coalesceTraversals); Bytecode.AddStep("coalesce", args.ToArray()); return Wrap< S , E2 >(this); @@ -458,7 +458,7 @@ public GraphTraversal< S , E > CyclicPath () /// public GraphTraversal< S , E > Dedup (Scope scope, params string[] dedupLabels) { - var args = new List(1 + dedupLabels.Length) {scope}; + var args = new List< object >(1 + dedupLabels.Length) {scope}; args.AddRange(dedupLabels); Bytecode.AddStep("dedup", args.ToArray()); return Wrap< S , E >(this); @@ -469,7 +469,7 @@ public GraphTraversal< S , E > Dedup (Scope scope, params string[] dedupLabels) /// public GraphTraversal< S , E > Dedup (params string[] dedupLabels) { - var args = new List(0 + dedupLabels.Length) {}; + var args = new List< object >(0 + dedupLabels.Length) {}; args.AddRange(dedupLabels); Bytecode.AddStep("dedup", args.ToArray()); return Wrap< S , E >(this); @@ -723,7 +723,7 @@ public GraphTraversal< S , E > Has (T accessor, ITraversal propertyTraversal) /// public GraphTraversal< S , E > HasId (object id, params object[] otherIds) { - var args = new List(1 + otherIds.Length) {id}; + var args = new List< object >(1 + otherIds.Length) {id}; args.AddRange(otherIds); Bytecode.AddStep("hasId", args.ToArray()); return Wrap< S , E >(this); @@ -752,7 +752,7 @@ public GraphTraversal< S , E > HasKey (TraversalPredicate predicate) /// public GraphTraversal< S , E > HasKey (string label, params string[] otherLabels) { - var args = new List(1 + otherLabels.Length) {label}; + var args = new List< object >(1 + otherLabels.Length) {label}; args.AddRange(otherLabels); Bytecode.AddStep("hasKey", args.ToArray()); return Wrap< S , E >(this); @@ -772,7 +772,7 @@ public GraphTraversal< S , E > HasLabel (TraversalPredicate predicate) /// public GraphTraversal< S , E > HasLabel (string label, params string[] otherLabels) { - var args = new List(1 + otherLabels.Length) {label}; + var args = new List< object >(1 + otherLabels.Length) {label}; args.AddRange(otherLabels); Bytecode.AddStep("hasLabel", args.ToArray()); return Wrap< S , E >(this); @@ -792,7 +792,7 @@ public GraphTraversal< S , E > HasNot (string propertyKey) /// public GraphTraversal< S , E > HasValue (object value, params object[] otherValues) { - var args = new List(1 + otherValues.Length) {value}; + var args = new List< object >(1 + otherValues.Length) {value}; args.AddRange(otherValues); Bytecode.AddStep("hasValue", args.ToArray()); return Wrap< S , E >(this); @@ -830,7 +830,7 @@ public GraphTraversal< S , E > Identity () /// public GraphTraversal< S , Vertex > In (params string[] edgeLabels) { - var args = new List(0 + edgeLabels.Length) {}; + var args = new List< object >(0 + edgeLabels.Length) {}; args.AddRange(edgeLabels); Bytecode.AddStep("in", args.ToArray()); return Wrap< S , Vertex >(this); @@ -841,7 +841,7 @@ public GraphTraversal< S , Vertex > In (params string[] edgeLabels) /// public GraphTraversal< S , Edge > InE (params string[] edgeLabels) { - var args = new List(0 + edgeLabels.Length) {}; + var args = new List< object >(0 + edgeLabels.Length) {}; args.AddRange(edgeLabels); Bytecode.AddStep("inE", args.ToArray()); return Wrap< S , Edge >(this); @@ -859,9 +859,9 @@ public GraphTraversal< S , Vertex > InV () /// /// Adds the inject step to this . /// - public GraphTraversal< S , E > Inject (params object[] injections) + public GraphTraversal< S , E > Inject (params E[] injections) { - var args = new List(0 + injections.Length) {}; + var args = new List< E >(0 + injections.Length) {}; args.AddRange(injections); Bytecode.AddStep("inject", args.ToArray()); return Wrap< S , E >(this); @@ -980,7 +980,7 @@ public GraphTraversal< S , E2 > MapValues () /// public GraphTraversal< S , IDictionary > Match (params ITraversal[] matchTraversals) { - var args = new List(0 + matchTraversals.Length) {}; + var args = new List< object >(0 + matchTraversals.Length) {}; args.AddRange(matchTraversals); Bytecode.AddStep("match", args.ToArray()); return Wrap< S , IDictionary >(this); @@ -1081,7 +1081,7 @@ public GraphTraversal< S , E2 > Optional (ITraversal optionalTraversal) /// public GraphTraversal< S , E > Or (params ITraversal[] orTraversals) { - var args = new List(0 + orTraversals.Length) {}; + var args = new List< object >(0 + orTraversals.Length) {}; args.AddRange(orTraversals); Bytecode.AddStep("or", args.ToArray()); return Wrap< S , E >(this); @@ -1119,7 +1119,7 @@ public GraphTraversal< S , Vertex > OtherV () /// public GraphTraversal< S , Vertex > Out (params string[] edgeLabels) { - var args = new List(0 + edgeLabels.Length) {}; + var args = new List< object >(0 + edgeLabels.Length) {}; args.AddRange(edgeLabels); Bytecode.AddStep("out", args.ToArray()); return Wrap< S , Vertex >(this); @@ -1130,7 +1130,7 @@ public GraphTraversal< S , Vertex > Out (params string[] edgeLabels) /// public GraphTraversal< S , Edge > OutE (params string[] edgeLabels) { - var args = new List(0 + edgeLabels.Length) {}; + var args = new List< object >(0 + edgeLabels.Length) {}; args.AddRange(edgeLabels); Bytecode.AddStep("outE", args.ToArray()); return Wrap< S , Edge >(this); @@ -1213,7 +1213,7 @@ public GraphTraversal< S , E > Program (object vertexProgram) /// public GraphTraversal< S , IDictionary > Project (string projectKey, params string[] otherProjectKeys) { - var args = new List(1 + otherProjectKeys.Length) {projectKey}; + var args = new List< object >(1 + otherProjectKeys.Length) {projectKey}; args.AddRange(otherProjectKeys); Bytecode.AddStep("project", args.ToArray()); return Wrap< S , IDictionary >(this); @@ -1224,7 +1224,7 @@ public GraphTraversal< S , IDictionary > Project (string project /// public GraphTraversal< S , E2 > Properties (params string[] propertyKeys) { - var args = new List(0 + propertyKeys.Length) {}; + var args = new List< object >(0 + propertyKeys.Length) {}; args.AddRange(propertyKeys); Bytecode.AddStep("properties", args.ToArray()); return Wrap< S , E2 >(this); @@ -1235,7 +1235,7 @@ public GraphTraversal< S , E2 > Properties (params string[] propertyKeys) /// public GraphTraversal< S , E > Property (Cardinality cardinality, object key, object value, params object[] keyValues) { - var args = new List(3 + keyValues.Length) {cardinality, key, value}; + var args = new List< object >(3 + keyValues.Length) {cardinality, key, value}; args.AddRange(keyValues); Bytecode.AddStep("property", args.ToArray()); return Wrap< S , E >(this); @@ -1246,7 +1246,7 @@ public GraphTraversal< S , E > Property (Cardinality cardinality, object key, ob /// public GraphTraversal< S , E > Property (object key, object value, params object[] keyValues) { - var args = new List(2 + keyValues.Length) {key, value}; + var args = new List< object >(2 + keyValues.Length) {key, value}; args.AddRange(keyValues); Bytecode.AddStep("property", args.ToArray()); return Wrap< S , E >(this); @@ -1257,7 +1257,7 @@ public GraphTraversal< S , E > Property (object key, object value, params object /// public GraphTraversal< S , IDictionary > PropertyMap (params string[] propertyKeys) { - var args = new List(0 + propertyKeys.Length) {}; + var args = new List< object >(0 + propertyKeys.Length) {}; args.AddRange(propertyKeys); Bytecode.AddStep("propertyMap", args.ToArray()); return Wrap< S , IDictionary >(this); @@ -1358,7 +1358,7 @@ public GraphTraversal< S , E2 > Select (Pop pop, string selectKey) /// public GraphTraversal< S , IDictionary > Select (Pop pop, string selectKey1, string selectKey2, params string[] otherSelectKeys) { - var args = new List(3 + otherSelectKeys.Length) {pop, selectKey1, selectKey2}; + var args = new List< object >(3 + otherSelectKeys.Length) {pop, selectKey1, selectKey2}; args.AddRange(otherSelectKeys); Bytecode.AddStep("select", args.ToArray()); return Wrap< S , IDictionary >(this); @@ -1378,7 +1378,7 @@ public GraphTraversal< S , E2 > Select (string selectKey) /// public GraphTraversal< S , IDictionary > Select (string selectKey1, string selectKey2, params string[] otherSelectKeys) { - var args = new List(2 + otherSelectKeys.Length) {selectKey1, selectKey2}; + var args = new List< object >(2 + otherSelectKeys.Length) {selectKey1, selectKey2}; args.AddRange(otherSelectKeys); Bytecode.AddStep("select", args.ToArray()); return Wrap< S , IDictionary >(this); @@ -1506,7 +1506,7 @@ public GraphTraversal< S , E > Times (int maxLoops) /// public GraphTraversal< S , Vertex > To (Direction direction, params string[] edgeLabels) { - var args = new List(1 + edgeLabels.Length) {direction}; + var args = new List< object >(1 + edgeLabels.Length) {direction}; args.AddRange(edgeLabels); Bytecode.AddStep("to", args.ToArray()); return Wrap< S , Vertex >(this); @@ -1535,7 +1535,7 @@ public GraphTraversal< S , E > To (ITraversal toVertex) /// public GraphTraversal< S , Edge > ToE (Direction direction, params string[] edgeLabels) { - var args = new List(1 + edgeLabels.Length) {direction}; + var args = new List< object >(1 + edgeLabels.Length) {direction}; args.AddRange(edgeLabels); Bytecode.AddStep("toE", args.ToArray()); return Wrap< S , Edge >(this); @@ -1582,7 +1582,7 @@ public GraphTraversal< S , E2 > Unfold () /// public GraphTraversal< S , E2 > Union (params ITraversal[] unionTraversals) { - var args = new List(0 + unionTraversals.Length) {}; + var args = new List< object >(0 + unionTraversals.Length) {}; args.AddRange(unionTraversals); Bytecode.AddStep("union", args.ToArray()); return Wrap< S , E2 >(this); @@ -1620,7 +1620,7 @@ public GraphTraversal< S , E2 > Value () /// public GraphTraversal< S , IDictionary > ValueMap (params string[] propertyKeys) { - var args = new List(0 + propertyKeys.Length) {}; + var args = new List< object >(0 + propertyKeys.Length) {}; args.AddRange(propertyKeys); Bytecode.AddStep("valueMap", args.ToArray()); return Wrap< S , IDictionary >(this); @@ -1631,7 +1631,7 @@ public GraphTraversal< S , IDictionary > ValueMap (params string /// public GraphTraversal< S , IDictionary > ValueMap (bool includeTokens, params string[] propertyKeys) { - var args = new List(1 + propertyKeys.Length) {includeTokens}; + var args = new List< object >(1 + propertyKeys.Length) {includeTokens}; args.AddRange(propertyKeys); Bytecode.AddStep("valueMap", args.ToArray()); return Wrap< S , IDictionary >(this); @@ -1642,7 +1642,7 @@ public GraphTraversal< S , IDictionary > ValueMap (bool includeT /// public GraphTraversal< S , E2 > Values (params string[] propertyKeys) { - var args = new List(0 + propertyKeys.Length) {}; + var args = new List< object >(0 + propertyKeys.Length) {}; args.AddRange(propertyKeys); Bytecode.AddStep("values", args.ToArray()); return Wrap< S , E2 >(this); diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs index c536a78691b..880a0f5e8fd 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs @@ -190,7 +190,7 @@ public GraphTraversalSource WithComputer(string graphComputer = null, int? worke public GraphTraversal< Edge,Edge > E(params object[] edgesIds) { var traversal = new GraphTraversal< Edge,Edge >(TraversalStrategies, new Bytecode(Bytecode)); - var args = new List(0 + edgesIds.Length) {}; + var args = new List< object >(0 + edgesIds.Length) {}; args.AddRange(edgesIds); traversal.Bytecode.AddStep("E", args.ToArray()); return traversal; @@ -203,7 +203,7 @@ public GraphTraversal< Edge,Edge > E(params object[] edgesIds) public GraphTraversal< Vertex,Vertex > V(params object[] vertexIds) { var traversal = new GraphTraversal< Vertex,Vertex >(TraversalStrategies, new Bytecode(Bytecode)); - var args = new List(0 + vertexIds.Length) {}; + var args = new List< object >(0 + vertexIds.Length) {}; args.AddRange(vertexIds); traversal.Bytecode.AddStep("V", args.ToArray()); return traversal; @@ -227,7 +227,7 @@ public GraphTraversal< Vertex,Vertex > AddV() public GraphTraversal< Vertex,Vertex > AddV(params object[] keyValues) { var traversal = new GraphTraversal< Vertex,Vertex >(TraversalStrategies, new Bytecode(Bytecode)); - var args = new List(0 + keyValues.Length) {}; + var args = new List< object >(0 + keyValues.Length) {}; args.AddRange(keyValues); traversal.Bytecode.AddStep("addV", args.ToArray()); return traversal; @@ -248,10 +248,10 @@ public GraphTraversal< Vertex,Vertex > AddV(string label) /// Spawns a off this graph traversal source and adds the inject step to that /// traversal. /// - public GraphTraversal< S,S > Inject(params object[] starts) + public GraphTraversal< S,S > Inject(params S[] starts) { var traversal = new GraphTraversal< S,S >(TraversalStrategies, new Bytecode(Bytecode)); - var args = new List(0 + starts.Length) {}; + var args = new List< S >(0 + starts.Length) {}; args.AddRange(starts); traversal.Bytecode.AddStep("inject", args.ToArray()); return traversal; From 535b309e61f1dc5291c25f3ff36e42d008c264ab Mon Sep 17 00:00:00 2001 From: florianhockmann Date: Thu, 18 Jan 2018 19:37:07 +0100 Subject: [PATCH 3/3] TINKERPOP-1868 Remove unnecessary spaces --- gremlin-dotnet/glv/GraphTraversal.template | 6 +- .../glv/GraphTraversalSource.template | 6 +- gremlin-dotnet/glv/generate.groovy | 3 +- .../Process/Traversal/GraphTraversal.cs | 758 +++++++++--------- .../Process/Traversal/GraphTraversalSource.cs | 32 +- 5 files changed, 403 insertions(+), 402 deletions(-) diff --git a/gremlin-dotnet/glv/GraphTraversal.template b/gremlin-dotnet/glv/GraphTraversal.template index 810516f3c7c..67384674652 100644 --- a/gremlin-dotnet/glv/GraphTraversal.template +++ b/gremlin-dotnet/glv/GraphTraversal.template @@ -65,10 +65,10 @@ namespace Gremlin.Net.Process.Traversal /// /// Adds the <%= method.methodName %> step to this . /// - public GraphTraversal< <%= method.t1 %> , <%= method.t2 %> > <%= toCSharpMethodName.call(method.methodName) %><%= method.tParam %> (<%= method.parameters %>) + public GraphTraversal<$method.t1, $method.t2> <%= toCSharpMethodName.call(method.methodName) %><%= method.tParam %> (<%= method.parameters %>) { <% if (method.parameters.contains("params ")) { - %> var args = new List< <%= method.argsListType %> >(<%= method.paramNames.init().size() %> + <%= method.paramNames.last() %>.Length) {<%= method.paramNames.init().join(", ") %>}; + %> var args = new List<$method.argsListType>(<%= method.paramNames.init().size() %> + <%= method.paramNames.last() %>.Length) {<%= method.paramNames.init().join(", ") %>}; args.AddRange(<%= method.paramNames.last() %>); Bytecode.AddStep("<%= method.methodName %>", args.ToArray());<% } @@ -76,7 +76,7 @@ namespace Gremlin.Net.Process.Traversal %> Bytecode.AddStep("<%= method.methodName %>"<% if (method.parameters) out << ', '+ method.paramNames.join(", ") %>);<% } %> - return Wrap< <%= method.t1 %> , <%= method.t2 %> >(this); + return Wrap<$method.t1, $method.t2>(this); } <% } %> } diff --git a/gremlin-dotnet/glv/GraphTraversalSource.template b/gremlin-dotnet/glv/GraphTraversalSource.template index f8b0acf1092..afa42973dee 100644 --- a/gremlin-dotnet/glv/GraphTraversalSource.template +++ b/gremlin-dotnet/glv/GraphTraversalSource.template @@ -127,11 +127,11 @@ namespace Gremlin.Net.Process.Traversal /// Spawns a off this graph traversal source and adds the <%= method.methodName %> step to that /// traversal. /// - public GraphTraversal< <%= method.typeNames.join(",") %> > <%= toCSharpMethodName.call(method.methodName) %><%= method.tParam %>(<%= method.parameters %>) + public GraphTraversal<$method.typeNameString> <%= toCSharpMethodName.call(method.methodName) %><%= method.tParam %>(<%= method.parameters %>) { - var traversal = new GraphTraversal< <%= method.typeNames.join(",") %> >(TraversalStrategies, new Bytecode(Bytecode)); + var traversal = new GraphTraversal<$method.typeNameString>(TraversalStrategies, new Bytecode(Bytecode)); <% if (method.parameters.contains("params ")) { - %>var args = new List< <%= method.argsListType %> >(<%= method.paramNames.init().size() %> + <%= method.paramNames.last() %>.Length) {<%= method.paramNames.init().join(", ") %>}; + %>var args = new List<$method.argsListType>(<%= method.paramNames.init().size() %> + <%= method.paramNames.last() %>.Length) {<%= method.paramNames.init().join(", ") %>}; args.AddRange(<%= method.paramNames.last() %>); traversal.Bytecode.AddStep("<%= method.methodName %>", args.ToArray());<% } diff --git a/gremlin-dotnet/glv/generate.groovy b/gremlin-dotnet/glv/generate.groovy index 81b2f83fd5e..12cfa88a3a5 100644 --- a/gremlin-dotnet/glv/generate.groovy +++ b/gremlin-dotnet/glv/generate.groovy @@ -265,12 +265,13 @@ def binding = ["pmethods": P.class.getMethods(). unique { a,b -> a.name <=> b.name ?: getCSharpParamTypeString(a) <=> getCSharpParamTypeString(b) }. collect { javaMethod -> def typeNames = getJavaGenericTypeParameterTypeNames(javaMethod) + def typeNameString = typeNames.join(", ") def t2 = toCSharpType(typeNames[1]) def tParam = getCSharpGenericTypeParam(t2) def parameters = getCSharpParamString(javaMethod, true) def paramNames = getParamNames(javaMethod.parameters) def argsListType = getArgsListType(parameters) - return ["methodName": javaMethod.name, "typeNames": typeNames, "tParam":tParam, "parameters":parameters, "paramNames":paramNames, "argsListType":argsListType] + return ["methodName": javaMethod.name, "typeNameString": typeNameString, "tParam":tParam, "parameters":parameters, "paramNames":paramNames, "argsListType":argsListType] }, "graphStepMethods": GraphTraversal.getMethods(). findAll { GraphTraversal.class.equals(it.returnType) }. diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs index ed4b86791d8..d8e26ad1fa8 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs @@ -65,1614 +65,1614 @@ private static GraphTraversal Wrap(GraphTraversal traversa /// /// Adds the V step to this . /// - public GraphTraversal< S , Vertex > V (params object[] vertexIdsOrElements) + public GraphTraversal V (params object[] vertexIdsOrElements) { - var args = new List< object >(0 + vertexIdsOrElements.Length) {}; + var args = new List(0 + vertexIdsOrElements.Length) {}; args.AddRange(vertexIdsOrElements); Bytecode.AddStep("V", args.ToArray()); - return Wrap< S , Vertex >(this); + return Wrap(this); } /// /// Adds the addE step to this . /// - public GraphTraversal< S , Edge > AddE (Direction direction, string firstVertexKeyOrEdgeLabel, string edgeLabelOrSecondVertexKey, params object[] propertyKeyValues) + public GraphTraversal AddE (Direction direction, string firstVertexKeyOrEdgeLabel, string edgeLabelOrSecondVertexKey, params object[] propertyKeyValues) { - var args = new List< object >(3 + propertyKeyValues.Length) {direction, firstVertexKeyOrEdgeLabel, edgeLabelOrSecondVertexKey}; + var args = new List(3 + propertyKeyValues.Length) {direction, firstVertexKeyOrEdgeLabel, edgeLabelOrSecondVertexKey}; args.AddRange(propertyKeyValues); Bytecode.AddStep("addE", args.ToArray()); - return Wrap< S , Edge >(this); + return Wrap(this); } /// /// Adds the addE step to this . /// - public GraphTraversal< S , Edge > AddE (string edgeLabel) + public GraphTraversal AddE (string edgeLabel) { Bytecode.AddStep("addE", edgeLabel); - return Wrap< S , Edge >(this); + return Wrap(this); } /// /// Adds the addInE step to this . /// - public GraphTraversal< S , Edge > AddInE (string firstVertexKeyOrEdgeLabel, string edgeLabelOrSecondVertexKey, params object[] propertyKeyValues) + public GraphTraversal AddInE (string firstVertexKeyOrEdgeLabel, string edgeLabelOrSecondVertexKey, params object[] propertyKeyValues) { - var args = new List< object >(2 + propertyKeyValues.Length) {firstVertexKeyOrEdgeLabel, edgeLabelOrSecondVertexKey}; + var args = new List(2 + propertyKeyValues.Length) {firstVertexKeyOrEdgeLabel, edgeLabelOrSecondVertexKey}; args.AddRange(propertyKeyValues); Bytecode.AddStep("addInE", args.ToArray()); - return Wrap< S , Edge >(this); + return Wrap(this); } /// /// Adds the addOutE step to this . /// - public GraphTraversal< S , Edge > AddOutE (string firstVertexKeyOrEdgeLabel, string edgeLabelOrSecondVertexKey, params object[] propertyKeyValues) + public GraphTraversal AddOutE (string firstVertexKeyOrEdgeLabel, string edgeLabelOrSecondVertexKey, params object[] propertyKeyValues) { - var args = new List< object >(2 + propertyKeyValues.Length) {firstVertexKeyOrEdgeLabel, edgeLabelOrSecondVertexKey}; + var args = new List(2 + propertyKeyValues.Length) {firstVertexKeyOrEdgeLabel, edgeLabelOrSecondVertexKey}; args.AddRange(propertyKeyValues); Bytecode.AddStep("addOutE", args.ToArray()); - return Wrap< S , Edge >(this); + return Wrap(this); } /// /// Adds the addV step to this . /// - public GraphTraversal< S , Vertex > AddV () + public GraphTraversal AddV () { Bytecode.AddStep("addV"); - return Wrap< S , Vertex >(this); + return Wrap(this); } /// /// Adds the addV step to this . /// - public GraphTraversal< S , Vertex > AddV (params object[] propertyKeyValues) + public GraphTraversal AddV (params object[] propertyKeyValues) { - var args = new List< object >(0 + propertyKeyValues.Length) {}; + var args = new List(0 + propertyKeyValues.Length) {}; args.AddRange(propertyKeyValues); Bytecode.AddStep("addV", args.ToArray()); - return Wrap< S , Vertex >(this); + return Wrap(this); } /// /// Adds the addV step to this . /// - public GraphTraversal< S , Vertex > AddV (string vertexLabel) + public GraphTraversal AddV (string vertexLabel) { Bytecode.AddStep("addV", vertexLabel); - return Wrap< S , Vertex >(this); + return Wrap(this); } /// /// Adds the aggregate step to this . /// - public GraphTraversal< S , E > Aggregate (string sideEffectKey) + public GraphTraversal Aggregate (string sideEffectKey) { Bytecode.AddStep("aggregate", sideEffectKey); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the and step to this . /// - public GraphTraversal< S , E > And (params ITraversal[] andTraversals) + public GraphTraversal And (params ITraversal[] andTraversals) { - var args = new List< object >(0 + andTraversals.Length) {}; + var args = new List(0 + andTraversals.Length) {}; args.AddRange(andTraversals); Bytecode.AddStep("and", args.ToArray()); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the as step to this . /// - public GraphTraversal< S , E > As (string stepLabel, params string[] stepLabels) + public GraphTraversal As (string stepLabel, params string[] stepLabels) { - var args = new List< object >(1 + stepLabels.Length) {stepLabel}; + var args = new List(1 + stepLabels.Length) {stepLabel}; args.AddRange(stepLabels); Bytecode.AddStep("as", args.ToArray()); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the barrier step to this . /// - public GraphTraversal< S , E > Barrier () + public GraphTraversal Barrier () { Bytecode.AddStep("barrier"); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the barrier step to this . /// - public GraphTraversal< S , E > Barrier (object barrierConsumer) + public GraphTraversal Barrier (object barrierConsumer) { Bytecode.AddStep("barrier", barrierConsumer); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the barrier step to this . /// - public GraphTraversal< S , E > Barrier (int maxBarrierSize) + public GraphTraversal Barrier (int maxBarrierSize) { Bytecode.AddStep("barrier", maxBarrierSize); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the both step to this . /// - public GraphTraversal< S , Vertex > Both (params string[] edgeLabels) + public GraphTraversal Both (params string[] edgeLabels) { - var args = new List< object >(0 + edgeLabels.Length) {}; + var args = new List(0 + edgeLabels.Length) {}; args.AddRange(edgeLabels); Bytecode.AddStep("both", args.ToArray()); - return Wrap< S , Vertex >(this); + return Wrap(this); } /// /// Adds the bothE step to this . /// - public GraphTraversal< S , Edge > BothE (params string[] edgeLabels) + public GraphTraversal BothE (params string[] edgeLabels) { - var args = new List< object >(0 + edgeLabels.Length) {}; + var args = new List(0 + edgeLabels.Length) {}; args.AddRange(edgeLabels); Bytecode.AddStep("bothE", args.ToArray()); - return Wrap< S , Edge >(this); + return Wrap(this); } /// /// Adds the bothV step to this . /// - public GraphTraversal< S , Vertex > BothV () + public GraphTraversal BothV () { Bytecode.AddStep("bothV"); - return Wrap< S , Vertex >(this); + return Wrap(this); } /// /// Adds the branch step to this . /// - public GraphTraversal< S , E2 > Branch (object function) + public GraphTraversal Branch (object function) { Bytecode.AddStep("branch", function); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the branch step to this . /// - public GraphTraversal< S , E2 > Branch (ITraversal branchTraversal) + public GraphTraversal Branch (ITraversal branchTraversal) { Bytecode.AddStep("branch", branchTraversal); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the by step to this . /// - public GraphTraversal< S , E > By () + public GraphTraversal By () { Bytecode.AddStep("by"); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the by step to this . /// - public GraphTraversal< S , E > By (object comparator) + public GraphTraversal By (object comparator) { Bytecode.AddStep("by", comparator); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the by step to this . /// - public GraphTraversal< S , E > By (object function, object comparator) + public GraphTraversal By (object function, object comparator) { Bytecode.AddStep("by", function, comparator); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the by step to this . /// - public GraphTraversal< S , E > By (Order order) + public GraphTraversal By (Order order) { Bytecode.AddStep("by", order); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the by step to this . /// - public GraphTraversal< S , E > By (string key) + public GraphTraversal By (string key) { Bytecode.AddStep("by", key); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the by step to this . /// - public GraphTraversal< S , E > By (string key, object comparator) + public GraphTraversal By (string key, object comparator) { Bytecode.AddStep("by", key, comparator); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the by step to this . /// - public GraphTraversal< S , E > By (T token) + public GraphTraversal By (T token) { Bytecode.AddStep("by", token); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the by step to this . /// - public GraphTraversal< S , E > By (ITraversal traversal) + public GraphTraversal By (ITraversal traversal) { Bytecode.AddStep("by", traversal); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the by step to this . /// - public GraphTraversal< S , E > By (ITraversal traversal, object comparator) + public GraphTraversal By (ITraversal traversal, object comparator) { Bytecode.AddStep("by", traversal, comparator); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the cap step to this . /// - public GraphTraversal< S , E2 > Cap (string sideEffectKey, params string[] sideEffectKeys) + public GraphTraversal Cap (string sideEffectKey, params string[] sideEffectKeys) { - var args = new List< object >(1 + sideEffectKeys.Length) {sideEffectKey}; + var args = new List(1 + sideEffectKeys.Length) {sideEffectKey}; args.AddRange(sideEffectKeys); Bytecode.AddStep("cap", args.ToArray()); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the choose step to this . /// - public GraphTraversal< S , E2 > Choose (object choiceFunction) + public GraphTraversal Choose (object choiceFunction) { Bytecode.AddStep("choose", choiceFunction); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the choose step to this . /// - public GraphTraversal< S , E2 > Choose (TraversalPredicate choosePredicate, ITraversal trueChoice) + public GraphTraversal Choose (TraversalPredicate choosePredicate, ITraversal trueChoice) { Bytecode.AddStep("choose", choosePredicate, trueChoice); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the choose step to this . /// - public GraphTraversal< S , E2 > Choose (TraversalPredicate choosePredicate, ITraversal trueChoice, ITraversal falseChoice) + public GraphTraversal Choose (TraversalPredicate choosePredicate, ITraversal trueChoice, ITraversal falseChoice) { Bytecode.AddStep("choose", choosePredicate, trueChoice, falseChoice); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the choose step to this . /// - public GraphTraversal< S , E2 > Choose (ITraversal choiceTraversal) + public GraphTraversal Choose (ITraversal choiceTraversal) { Bytecode.AddStep("choose", choiceTraversal); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the choose step to this . /// - public GraphTraversal< S , E2 > Choose (ITraversal traversalPredicate, ITraversal trueChoice) + public GraphTraversal Choose (ITraversal traversalPredicate, ITraversal trueChoice) { Bytecode.AddStep("choose", traversalPredicate, trueChoice); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the choose step to this . /// - public GraphTraversal< S , E2 > Choose (ITraversal traversalPredicate, ITraversal trueChoice, ITraversal falseChoice) + public GraphTraversal Choose (ITraversal traversalPredicate, ITraversal trueChoice, ITraversal falseChoice) { Bytecode.AddStep("choose", traversalPredicate, trueChoice, falseChoice); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the coalesce step to this . /// - public GraphTraversal< S , E2 > Coalesce (params ITraversal[] coalesceTraversals) + public GraphTraversal Coalesce (params ITraversal[] coalesceTraversals) { - var args = new List< object >(0 + coalesceTraversals.Length) {}; + var args = new List(0 + coalesceTraversals.Length) {}; args.AddRange(coalesceTraversals); Bytecode.AddStep("coalesce", args.ToArray()); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the coin step to this . /// - public GraphTraversal< S , E > Coin (double probability) + public GraphTraversal Coin (double probability) { Bytecode.AddStep("coin", probability); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the constant step to this . /// - public GraphTraversal< S , E2 > Constant (E2 e) + public GraphTraversal Constant (E2 e) { Bytecode.AddStep("constant", e); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the count step to this . /// - public GraphTraversal< S , long > Count () + public GraphTraversal Count () { Bytecode.AddStep("count"); - return Wrap< S , long >(this); + return Wrap(this); } /// /// Adds the count step to this . /// - public GraphTraversal< S , long > Count (Scope scope) + public GraphTraversal Count (Scope scope) { Bytecode.AddStep("count", scope); - return Wrap< S , long >(this); + return Wrap(this); } /// /// Adds the cyclicPath step to this . /// - public GraphTraversal< S , E > CyclicPath () + public GraphTraversal CyclicPath () { Bytecode.AddStep("cyclicPath"); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the dedup step to this . /// - public GraphTraversal< S , E > Dedup (Scope scope, params string[] dedupLabels) + public GraphTraversal Dedup (Scope scope, params string[] dedupLabels) { - var args = new List< object >(1 + dedupLabels.Length) {scope}; + var args = new List(1 + dedupLabels.Length) {scope}; args.AddRange(dedupLabels); Bytecode.AddStep("dedup", args.ToArray()); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the dedup step to this . /// - public GraphTraversal< S , E > Dedup (params string[] dedupLabels) + public GraphTraversal Dedup (params string[] dedupLabels) { - var args = new List< object >(0 + dedupLabels.Length) {}; + var args = new List(0 + dedupLabels.Length) {}; args.AddRange(dedupLabels); Bytecode.AddStep("dedup", args.ToArray()); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the drop step to this . /// - public GraphTraversal< S , E > Drop () + public GraphTraversal Drop () { Bytecode.AddStep("drop"); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the emit step to this . /// - public GraphTraversal< S , E > Emit () + public GraphTraversal Emit () { Bytecode.AddStep("emit"); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the emit step to this . /// - public GraphTraversal< S , E > Emit (TraversalPredicate emitPredicate) + public GraphTraversal Emit (TraversalPredicate emitPredicate) { Bytecode.AddStep("emit", emitPredicate); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the emit step to this . /// - public GraphTraversal< S , E > Emit (ITraversal emitTraversal) + public GraphTraversal Emit (ITraversal emitTraversal) { Bytecode.AddStep("emit", emitTraversal); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the filter step to this . /// - public GraphTraversal< S , E > Filter (TraversalPredicate predicate) + public GraphTraversal Filter (TraversalPredicate predicate) { Bytecode.AddStep("filter", predicate); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the filter step to this . /// - public GraphTraversal< S , E > Filter (ITraversal filterTraversal) + public GraphTraversal Filter (ITraversal filterTraversal) { Bytecode.AddStep("filter", filterTraversal); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the flatMap step to this . /// - public GraphTraversal< S , E2 > FlatMap (object function) + public GraphTraversal FlatMap (object function) { Bytecode.AddStep("flatMap", function); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the flatMap step to this . /// - public GraphTraversal< S , E2 > FlatMap (ITraversal flatMapTraversal) + public GraphTraversal FlatMap (ITraversal flatMapTraversal) { Bytecode.AddStep("flatMap", flatMapTraversal); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the fold step to this . /// - public GraphTraversal< S , IList > Fold () + public GraphTraversal> Fold () { Bytecode.AddStep("fold"); - return Wrap< S , IList >(this); + return Wrap>(this); } /// /// Adds the fold step to this . /// - public GraphTraversal< S , E2 > Fold (E2 seed, object foldFunction) + public GraphTraversal Fold (E2 seed, object foldFunction) { Bytecode.AddStep("fold", seed, foldFunction); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the from step to this . /// - public GraphTraversal< S , E > From (string fromStepLabel) + public GraphTraversal From (string fromStepLabel) { Bytecode.AddStep("from", fromStepLabel); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the from step to this . /// - public GraphTraversal< S , E > From (ITraversal fromVertex) + public GraphTraversal From (ITraversal fromVertex) { Bytecode.AddStep("from", fromVertex); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the group step to this . /// - public GraphTraversal< S , IDictionary > Group () + public GraphTraversal> Group () { Bytecode.AddStep("group"); - return Wrap< S , IDictionary >(this); + return Wrap>(this); } /// /// Adds the group step to this . /// - public GraphTraversal< S , E > Group (string sideEffectKey) + public GraphTraversal Group (string sideEffectKey) { Bytecode.AddStep("group", sideEffectKey); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the groupCount step to this . /// - public GraphTraversal< S , IDictionary > GroupCount () + public GraphTraversal> GroupCount () { Bytecode.AddStep("groupCount"); - return Wrap< S , IDictionary >(this); + return Wrap>(this); } /// /// Adds the groupCount step to this . /// - public GraphTraversal< S , E > GroupCount (string sideEffectKey) + public GraphTraversal GroupCount (string sideEffectKey) { Bytecode.AddStep("groupCount", sideEffectKey); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the groupV3d0 step to this . /// - public GraphTraversal< S , IDictionary > GroupV3d0 () + public GraphTraversal> GroupV3d0 () { Bytecode.AddStep("groupV3d0"); - return Wrap< S , IDictionary >(this); + return Wrap>(this); } /// /// Adds the groupV3d0 step to this . /// - public GraphTraversal< S , E > GroupV3d0 (string sideEffectKey) + public GraphTraversal GroupV3d0 (string sideEffectKey) { Bytecode.AddStep("groupV3d0", sideEffectKey); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the has step to this . /// - public GraphTraversal< S , E > Has (string propertyKey) + public GraphTraversal Has (string propertyKey) { Bytecode.AddStep("has", propertyKey); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the has step to this . /// - public GraphTraversal< S , E > Has (string propertyKey, object value) + public GraphTraversal Has (string propertyKey, object value) { Bytecode.AddStep("has", propertyKey, value); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the has step to this . /// - public GraphTraversal< S , E > Has (string propertyKey, TraversalPredicate predicate) + public GraphTraversal Has (string propertyKey, TraversalPredicate predicate) { Bytecode.AddStep("has", propertyKey, predicate); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the has step to this . /// - public GraphTraversal< S , E > Has (string label, string propertyKey, object value) + public GraphTraversal Has (string label, string propertyKey, object value) { Bytecode.AddStep("has", label, propertyKey, value); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the has step to this . /// - public GraphTraversal< S , E > Has (string label, string propertyKey, TraversalPredicate predicate) + public GraphTraversal Has (string label, string propertyKey, TraversalPredicate predicate) { Bytecode.AddStep("has", label, propertyKey, predicate); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the has step to this . /// - public GraphTraversal< S , E > Has (string propertyKey, ITraversal propertyTraversal) + public GraphTraversal Has (string propertyKey, ITraversal propertyTraversal) { Bytecode.AddStep("has", propertyKey, propertyTraversal); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the has step to this . /// - public GraphTraversal< S , E > Has (T accessor, object value) + public GraphTraversal Has (T accessor, object value) { Bytecode.AddStep("has", accessor, value); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the has step to this . /// - public GraphTraversal< S , E > Has (T accessor, TraversalPredicate predicate) + public GraphTraversal Has (T accessor, TraversalPredicate predicate) { Bytecode.AddStep("has", accessor, predicate); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the has step to this . /// - public GraphTraversal< S , E > Has (T accessor, ITraversal propertyTraversal) + public GraphTraversal Has (T accessor, ITraversal propertyTraversal) { Bytecode.AddStep("has", accessor, propertyTraversal); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the hasId step to this . /// - public GraphTraversal< S , E > HasId (object id, params object[] otherIds) + public GraphTraversal HasId (object id, params object[] otherIds) { - var args = new List< object >(1 + otherIds.Length) {id}; + var args = new List(1 + otherIds.Length) {id}; args.AddRange(otherIds); Bytecode.AddStep("hasId", args.ToArray()); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the hasId step to this . /// - public GraphTraversal< S , E > HasId (TraversalPredicate predicate) + public GraphTraversal HasId (TraversalPredicate predicate) { Bytecode.AddStep("hasId", predicate); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the hasKey step to this . /// - public GraphTraversal< S , E > HasKey (TraversalPredicate predicate) + public GraphTraversal HasKey (TraversalPredicate predicate) { Bytecode.AddStep("hasKey", predicate); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the hasKey step to this . /// - public GraphTraversal< S , E > HasKey (string label, params string[] otherLabels) + public GraphTraversal HasKey (string label, params string[] otherLabels) { - var args = new List< object >(1 + otherLabels.Length) {label}; + var args = new List(1 + otherLabels.Length) {label}; args.AddRange(otherLabels); Bytecode.AddStep("hasKey", args.ToArray()); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the hasLabel step to this . /// - public GraphTraversal< S , E > HasLabel (TraversalPredicate predicate) + public GraphTraversal HasLabel (TraversalPredicate predicate) { Bytecode.AddStep("hasLabel", predicate); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the hasLabel step to this . /// - public GraphTraversal< S , E > HasLabel (string label, params string[] otherLabels) + public GraphTraversal HasLabel (string label, params string[] otherLabels) { - var args = new List< object >(1 + otherLabels.Length) {label}; + var args = new List(1 + otherLabels.Length) {label}; args.AddRange(otherLabels); Bytecode.AddStep("hasLabel", args.ToArray()); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the hasNot step to this . /// - public GraphTraversal< S , E > HasNot (string propertyKey) + public GraphTraversal HasNot (string propertyKey) { Bytecode.AddStep("hasNot", propertyKey); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the hasValue step to this . /// - public GraphTraversal< S , E > HasValue (object value, params object[] otherValues) + public GraphTraversal HasValue (object value, params object[] otherValues) { - var args = new List< object >(1 + otherValues.Length) {value}; + var args = new List(1 + otherValues.Length) {value}; args.AddRange(otherValues); Bytecode.AddStep("hasValue", args.ToArray()); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the hasValue step to this . /// - public GraphTraversal< S , E > HasValue (TraversalPredicate predicate) + public GraphTraversal HasValue (TraversalPredicate predicate) { Bytecode.AddStep("hasValue", predicate); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the id step to this . /// - public GraphTraversal< S , object > Id () + public GraphTraversal Id () { Bytecode.AddStep("id"); - return Wrap< S , object >(this); + return Wrap(this); } /// /// Adds the identity step to this . /// - public GraphTraversal< S , E > Identity () + public GraphTraversal Identity () { Bytecode.AddStep("identity"); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the in step to this . /// - public GraphTraversal< S , Vertex > In (params string[] edgeLabels) + public GraphTraversal In (params string[] edgeLabels) { - var args = new List< object >(0 + edgeLabels.Length) {}; + var args = new List(0 + edgeLabels.Length) {}; args.AddRange(edgeLabels); Bytecode.AddStep("in", args.ToArray()); - return Wrap< S , Vertex >(this); + return Wrap(this); } /// /// Adds the inE step to this . /// - public GraphTraversal< S , Edge > InE (params string[] edgeLabels) + public GraphTraversal InE (params string[] edgeLabels) { - var args = new List< object >(0 + edgeLabels.Length) {}; + var args = new List(0 + edgeLabels.Length) {}; args.AddRange(edgeLabels); Bytecode.AddStep("inE", args.ToArray()); - return Wrap< S , Edge >(this); + return Wrap(this); } /// /// Adds the inV step to this . /// - public GraphTraversal< S , Vertex > InV () + public GraphTraversal InV () { Bytecode.AddStep("inV"); - return Wrap< S , Vertex >(this); + return Wrap(this); } /// /// Adds the inject step to this . /// - public GraphTraversal< S , E > Inject (params E[] injections) + public GraphTraversal Inject (params E[] injections) { - var args = new List< E >(0 + injections.Length) {}; + var args = new List(0 + injections.Length) {}; args.AddRange(injections); Bytecode.AddStep("inject", args.ToArray()); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the is step to this . /// - public GraphTraversal< S , E > Is (object value) + public GraphTraversal Is (object value) { Bytecode.AddStep("is", value); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the is step to this . /// - public GraphTraversal< S , E > Is (TraversalPredicate predicate) + public GraphTraversal Is (TraversalPredicate predicate) { Bytecode.AddStep("is", predicate); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the key step to this . /// - public GraphTraversal< S , string > Key () + public GraphTraversal Key () { Bytecode.AddStep("key"); - return Wrap< S , string >(this); + return Wrap(this); } /// /// Adds the label step to this . /// - public GraphTraversal< S , string > Label () + public GraphTraversal Label () { Bytecode.AddStep("label"); - return Wrap< S , string >(this); + return Wrap(this); } /// /// Adds the limit step to this . /// - public GraphTraversal< S , E2 > Limit (Scope scope, long limit) + public GraphTraversal Limit (Scope scope, long limit) { Bytecode.AddStep("limit", scope, limit); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the limit step to this . /// - public GraphTraversal< S , E > Limit (long limit) + public GraphTraversal Limit (long limit) { Bytecode.AddStep("limit", limit); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the local step to this . /// - public GraphTraversal< S , E2 > Local (ITraversal localTraversal) + public GraphTraversal Local (ITraversal localTraversal) { Bytecode.AddStep("local", localTraversal); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the loops step to this . /// - public GraphTraversal< S , int > Loops () + public GraphTraversal Loops () { Bytecode.AddStep("loops"); - return Wrap< S , int >(this); + return Wrap(this); } /// /// Adds the map step to this . /// - public GraphTraversal< S , E2 > Map (object function) + public GraphTraversal Map (object function) { Bytecode.AddStep("map", function); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the map step to this . /// - public GraphTraversal< S , E2 > Map (ITraversal mapTraversal) + public GraphTraversal Map (ITraversal mapTraversal) { Bytecode.AddStep("map", mapTraversal); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the mapKeys step to this . /// - public GraphTraversal< S , E2 > MapKeys () + public GraphTraversal MapKeys () { Bytecode.AddStep("mapKeys"); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the mapValues step to this . /// - public GraphTraversal< S , E2 > MapValues () + public GraphTraversal MapValues () { Bytecode.AddStep("mapValues"); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the match step to this . /// - public GraphTraversal< S , IDictionary > Match (params ITraversal[] matchTraversals) + public GraphTraversal> Match (params ITraversal[] matchTraversals) { - var args = new List< object >(0 + matchTraversals.Length) {}; + var args = new List(0 + matchTraversals.Length) {}; args.AddRange(matchTraversals); Bytecode.AddStep("match", args.ToArray()); - return Wrap< S , IDictionary >(this); + return Wrap>(this); } /// /// Adds the max step to this . /// - public GraphTraversal< S , E2 > Max () + public GraphTraversal Max () { Bytecode.AddStep("max"); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the max step to this . /// - public GraphTraversal< S , E2 > Max (Scope scope) + public GraphTraversal Max (Scope scope) { Bytecode.AddStep("max", scope); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the mean step to this . /// - public GraphTraversal< S , E2 > Mean () + public GraphTraversal Mean () { Bytecode.AddStep("mean"); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the mean step to this . /// - public GraphTraversal< S , E2 > Mean (Scope scope) + public GraphTraversal Mean (Scope scope) { Bytecode.AddStep("mean", scope); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the min step to this . /// - public GraphTraversal< S , E2 > Min () + public GraphTraversal Min () { Bytecode.AddStep("min"); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the min step to this . /// - public GraphTraversal< S , E2 > Min (Scope scope) + public GraphTraversal Min (Scope scope) { Bytecode.AddStep("min", scope); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the not step to this . /// - public GraphTraversal< S , E > Not (ITraversal notTraversal) + public GraphTraversal Not (ITraversal notTraversal) { Bytecode.AddStep("not", notTraversal); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the option step to this . /// - public GraphTraversal< S , E > Option (object pickToken, ITraversal traversalOption) + public GraphTraversal Option (object pickToken, ITraversal traversalOption) { Bytecode.AddStep("option", pickToken, traversalOption); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the option step to this . /// - public GraphTraversal< S , E > Option (ITraversal traversalOption) + public GraphTraversal Option (ITraversal traversalOption) { Bytecode.AddStep("option", traversalOption); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the optional step to this . /// - public GraphTraversal< S , E2 > Optional (ITraversal optionalTraversal) + public GraphTraversal Optional (ITraversal optionalTraversal) { Bytecode.AddStep("optional", optionalTraversal); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the or step to this . /// - public GraphTraversal< S , E > Or (params ITraversal[] orTraversals) + public GraphTraversal Or (params ITraversal[] orTraversals) { - var args = new List< object >(0 + orTraversals.Length) {}; + var args = new List(0 + orTraversals.Length) {}; args.AddRange(orTraversals); Bytecode.AddStep("or", args.ToArray()); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the order step to this . /// - public GraphTraversal< S , E > Order () + public GraphTraversal Order () { Bytecode.AddStep("order"); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the order step to this . /// - public GraphTraversal< S , E > Order (Scope scope) + public GraphTraversal Order (Scope scope) { Bytecode.AddStep("order", scope); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the otherV step to this . /// - public GraphTraversal< S , Vertex > OtherV () + public GraphTraversal OtherV () { Bytecode.AddStep("otherV"); - return Wrap< S , Vertex >(this); + return Wrap(this); } /// /// Adds the out step to this . /// - public GraphTraversal< S , Vertex > Out (params string[] edgeLabels) + public GraphTraversal Out (params string[] edgeLabels) { - var args = new List< object >(0 + edgeLabels.Length) {}; + var args = new List(0 + edgeLabels.Length) {}; args.AddRange(edgeLabels); Bytecode.AddStep("out", args.ToArray()); - return Wrap< S , Vertex >(this); + return Wrap(this); } /// /// Adds the outE step to this . /// - public GraphTraversal< S , Edge > OutE (params string[] edgeLabels) + public GraphTraversal OutE (params string[] edgeLabels) { - var args = new List< object >(0 + edgeLabels.Length) {}; + var args = new List(0 + edgeLabels.Length) {}; args.AddRange(edgeLabels); Bytecode.AddStep("outE", args.ToArray()); - return Wrap< S , Edge >(this); + return Wrap(this); } /// /// Adds the outV step to this . /// - public GraphTraversal< S , Vertex > OutV () + public GraphTraversal OutV () { Bytecode.AddStep("outV"); - return Wrap< S , Vertex >(this); + return Wrap(this); } /// /// Adds the pageRank step to this . /// - public GraphTraversal< S , E > PageRank () + public GraphTraversal PageRank () { Bytecode.AddStep("pageRank"); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the pageRank step to this . /// - public GraphTraversal< S , E > PageRank (double alpha) + public GraphTraversal PageRank (double alpha) { Bytecode.AddStep("pageRank", alpha); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the path step to this . /// - public GraphTraversal< S , Path > Path () + public GraphTraversal Path () { Bytecode.AddStep("path"); - return Wrap< S , Path >(this); + return Wrap(this); } /// /// Adds the peerPressure step to this . /// - public GraphTraversal< S , E > PeerPressure () + public GraphTraversal PeerPressure () { Bytecode.AddStep("peerPressure"); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the profile step to this . /// - public GraphTraversal< S , E2 > Profile () + public GraphTraversal Profile () { Bytecode.AddStep("profile"); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the profile step to this . /// - public GraphTraversal< S , E > Profile (string sideEffectKey) + public GraphTraversal Profile (string sideEffectKey) { Bytecode.AddStep("profile", sideEffectKey); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the program step to this . /// - public GraphTraversal< S , E > Program (object vertexProgram) + public GraphTraversal Program (object vertexProgram) { Bytecode.AddStep("program", vertexProgram); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the project step to this . /// - public GraphTraversal< S , IDictionary > Project (string projectKey, params string[] otherProjectKeys) + public GraphTraversal> Project (string projectKey, params string[] otherProjectKeys) { - var args = new List< object >(1 + otherProjectKeys.Length) {projectKey}; + var args = new List(1 + otherProjectKeys.Length) {projectKey}; args.AddRange(otherProjectKeys); Bytecode.AddStep("project", args.ToArray()); - return Wrap< S , IDictionary >(this); + return Wrap>(this); } /// /// Adds the properties step to this . /// - public GraphTraversal< S , E2 > Properties (params string[] propertyKeys) + public GraphTraversal Properties (params string[] propertyKeys) { - var args = new List< object >(0 + propertyKeys.Length) {}; + var args = new List(0 + propertyKeys.Length) {}; args.AddRange(propertyKeys); Bytecode.AddStep("properties", args.ToArray()); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the property step to this . /// - public GraphTraversal< S , E > Property (Cardinality cardinality, object key, object value, params object[] keyValues) + public GraphTraversal Property (Cardinality cardinality, object key, object value, params object[] keyValues) { - var args = new List< object >(3 + keyValues.Length) {cardinality, key, value}; + var args = new List(3 + keyValues.Length) {cardinality, key, value}; args.AddRange(keyValues); Bytecode.AddStep("property", args.ToArray()); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the property step to this . /// - public GraphTraversal< S , E > Property (object key, object value, params object[] keyValues) + public GraphTraversal Property (object key, object value, params object[] keyValues) { - var args = new List< object >(2 + keyValues.Length) {key, value}; + var args = new List(2 + keyValues.Length) {key, value}; args.AddRange(keyValues); Bytecode.AddStep("property", args.ToArray()); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the propertyMap step to this . /// - public GraphTraversal< S , IDictionary > PropertyMap (params string[] propertyKeys) + public GraphTraversal> PropertyMap (params string[] propertyKeys) { - var args = new List< object >(0 + propertyKeys.Length) {}; + var args = new List(0 + propertyKeys.Length) {}; args.AddRange(propertyKeys); Bytecode.AddStep("propertyMap", args.ToArray()); - return Wrap< S , IDictionary >(this); + return Wrap>(this); } /// /// Adds the range step to this . /// - public GraphTraversal< S , E2 > Range (Scope scope, long low, long high) + public GraphTraversal Range (Scope scope, long low, long high) { Bytecode.AddStep("range", scope, low, high); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the range step to this . /// - public GraphTraversal< S , E > Range (long low, long high) + public GraphTraversal Range (long low, long high) { Bytecode.AddStep("range", low, high); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the repeat step to this . /// - public GraphTraversal< S , E > Repeat (ITraversal repeatTraversal) + public GraphTraversal Repeat (ITraversal repeatTraversal) { Bytecode.AddStep("repeat", repeatTraversal); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the sack step to this . /// - public GraphTraversal< S , E2 > Sack () + public GraphTraversal Sack () { Bytecode.AddStep("sack"); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the sack step to this . /// - public GraphTraversal< S , E > Sack (object sackOperator) + public GraphTraversal Sack (object sackOperator) { Bytecode.AddStep("sack", sackOperator); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the sack step to this . /// - public GraphTraversal< S , E > Sack (object sackOperator, string elementPropertyKey) + public GraphTraversal Sack (object sackOperator, string elementPropertyKey) { Bytecode.AddStep("sack", sackOperator, elementPropertyKey); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the sample step to this . /// - public GraphTraversal< S , E > Sample (Scope scope, int amountToSample) + public GraphTraversal Sample (Scope scope, int amountToSample) { Bytecode.AddStep("sample", scope, amountToSample); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the sample step to this . /// - public GraphTraversal< S , E > Sample (int amountToSample) + public GraphTraversal Sample (int amountToSample) { Bytecode.AddStep("sample", amountToSample); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the select step to this . /// - public GraphTraversal< S , ICollection > Select (Column column) + public GraphTraversal> Select (Column column) { Bytecode.AddStep("select", column); - return Wrap< S , ICollection >(this); + return Wrap>(this); } /// /// Adds the select step to this . /// - public GraphTraversal< S , E2 > Select (Pop pop, string selectKey) + public GraphTraversal Select (Pop pop, string selectKey) { Bytecode.AddStep("select", pop, selectKey); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the select step to this . /// - public GraphTraversal< S , IDictionary > Select (Pop pop, string selectKey1, string selectKey2, params string[] otherSelectKeys) + public GraphTraversal> Select (Pop pop, string selectKey1, string selectKey2, params string[] otherSelectKeys) { - var args = new List< object >(3 + otherSelectKeys.Length) {pop, selectKey1, selectKey2}; + var args = new List(3 + otherSelectKeys.Length) {pop, selectKey1, selectKey2}; args.AddRange(otherSelectKeys); Bytecode.AddStep("select", args.ToArray()); - return Wrap< S , IDictionary >(this); + return Wrap>(this); } /// /// Adds the select step to this . /// - public GraphTraversal< S , E2 > Select (string selectKey) + public GraphTraversal Select (string selectKey) { Bytecode.AddStep("select", selectKey); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the select step to this . /// - public GraphTraversal< S , IDictionary > Select (string selectKey1, string selectKey2, params string[] otherSelectKeys) + public GraphTraversal> Select (string selectKey1, string selectKey2, params string[] otherSelectKeys) { - var args = new List< object >(2 + otherSelectKeys.Length) {selectKey1, selectKey2}; + var args = new List(2 + otherSelectKeys.Length) {selectKey1, selectKey2}; args.AddRange(otherSelectKeys); Bytecode.AddStep("select", args.ToArray()); - return Wrap< S , IDictionary >(this); + return Wrap>(this); } /// /// Adds the sideEffect step to this . /// - public GraphTraversal< S , E > SideEffect (object consumer) + public GraphTraversal SideEffect (object consumer) { Bytecode.AddStep("sideEffect", consumer); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the sideEffect step to this . /// - public GraphTraversal< S , E > SideEffect (ITraversal sideEffectTraversal) + public GraphTraversal SideEffect (ITraversal sideEffectTraversal) { Bytecode.AddStep("sideEffect", sideEffectTraversal); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the simplePath step to this . /// - public GraphTraversal< S , E > SimplePath () + public GraphTraversal SimplePath () { Bytecode.AddStep("simplePath"); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the store step to this . /// - public GraphTraversal< S , E > Store (string sideEffectKey) + public GraphTraversal Store (string sideEffectKey) { Bytecode.AddStep("store", sideEffectKey); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the subgraph step to this . /// - public GraphTraversal< S , Edge > Subgraph (string sideEffectKey) + public GraphTraversal Subgraph (string sideEffectKey) { Bytecode.AddStep("subgraph", sideEffectKey); - return Wrap< S , Edge >(this); + return Wrap(this); } /// /// Adds the sum step to this . /// - public GraphTraversal< S , E2 > Sum () + public GraphTraversal Sum () { Bytecode.AddStep("sum"); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the sum step to this . /// - public GraphTraversal< S , E2 > Sum (Scope scope) + public GraphTraversal Sum (Scope scope) { Bytecode.AddStep("sum", scope); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the tail step to this . /// - public GraphTraversal< S , E > Tail () + public GraphTraversal Tail () { Bytecode.AddStep("tail"); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the tail step to this . /// - public GraphTraversal< S , E2 > Tail (Scope scope) + public GraphTraversal Tail (Scope scope) { Bytecode.AddStep("tail", scope); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the tail step to this . /// - public GraphTraversal< S , E2 > Tail (Scope scope, long limit) + public GraphTraversal Tail (Scope scope, long limit) { Bytecode.AddStep("tail", scope, limit); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the tail step to this . /// - public GraphTraversal< S , E > Tail (long limit) + public GraphTraversal Tail (long limit) { Bytecode.AddStep("tail", limit); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the timeLimit step to this . /// - public GraphTraversal< S , E > TimeLimit (long timeLimit) + public GraphTraversal TimeLimit (long timeLimit) { Bytecode.AddStep("timeLimit", timeLimit); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the times step to this . /// - public GraphTraversal< S , E > Times (int maxLoops) + public GraphTraversal Times (int maxLoops) { Bytecode.AddStep("times", maxLoops); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the to step to this . /// - public GraphTraversal< S , Vertex > To (Direction direction, params string[] edgeLabels) + public GraphTraversal To (Direction direction, params string[] edgeLabels) { - var args = new List< object >(1 + edgeLabels.Length) {direction}; + var args = new List(1 + edgeLabels.Length) {direction}; args.AddRange(edgeLabels); Bytecode.AddStep("to", args.ToArray()); - return Wrap< S , Vertex >(this); + return Wrap(this); } /// /// Adds the to step to this . /// - public GraphTraversal< S , E > To (string toStepLabel) + public GraphTraversal To (string toStepLabel) { Bytecode.AddStep("to", toStepLabel); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the to step to this . /// - public GraphTraversal< S , E > To (ITraversal toVertex) + public GraphTraversal To (ITraversal toVertex) { Bytecode.AddStep("to", toVertex); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the toE step to this . /// - public GraphTraversal< S , Edge > ToE (Direction direction, params string[] edgeLabels) + public GraphTraversal ToE (Direction direction, params string[] edgeLabels) { - var args = new List< object >(1 + edgeLabels.Length) {direction}; + var args = new List(1 + edgeLabels.Length) {direction}; args.AddRange(edgeLabels); Bytecode.AddStep("toE", args.ToArray()); - return Wrap< S , Edge >(this); + return Wrap(this); } /// /// Adds the toV step to this . /// - public GraphTraversal< S , Vertex > ToV (Direction direction) + public GraphTraversal ToV (Direction direction) { Bytecode.AddStep("toV", direction); - return Wrap< S , Vertex >(this); + return Wrap(this); } /// /// Adds the tree step to this . /// - public GraphTraversal< S , E2 > Tree () + public GraphTraversal Tree () { Bytecode.AddStep("tree"); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the tree step to this . /// - public GraphTraversal< S , E > Tree (string sideEffectKey) + public GraphTraversal Tree (string sideEffectKey) { Bytecode.AddStep("tree", sideEffectKey); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the unfold step to this . /// - public GraphTraversal< S , E2 > Unfold () + public GraphTraversal Unfold () { Bytecode.AddStep("unfold"); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the union step to this . /// - public GraphTraversal< S , E2 > Union (params ITraversal[] unionTraversals) + public GraphTraversal Union (params ITraversal[] unionTraversals) { - var args = new List< object >(0 + unionTraversals.Length) {}; + var args = new List(0 + unionTraversals.Length) {}; args.AddRange(unionTraversals); Bytecode.AddStep("union", args.ToArray()); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the until step to this . /// - public GraphTraversal< S , E > Until (TraversalPredicate untilPredicate) + public GraphTraversal Until (TraversalPredicate untilPredicate) { Bytecode.AddStep("until", untilPredicate); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the until step to this . /// - public GraphTraversal< S , E > Until (ITraversal untilTraversal) + public GraphTraversal Until (ITraversal untilTraversal) { Bytecode.AddStep("until", untilTraversal); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the value step to this . /// - public GraphTraversal< S , E2 > Value () + public GraphTraversal Value () { Bytecode.AddStep("value"); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the valueMap step to this . /// - public GraphTraversal< S , IDictionary > ValueMap (params string[] propertyKeys) + public GraphTraversal> ValueMap (params string[] propertyKeys) { - var args = new List< object >(0 + propertyKeys.Length) {}; + var args = new List(0 + propertyKeys.Length) {}; args.AddRange(propertyKeys); Bytecode.AddStep("valueMap", args.ToArray()); - return Wrap< S , IDictionary >(this); + return Wrap>(this); } /// /// Adds the valueMap step to this . /// - public GraphTraversal< S , IDictionary > ValueMap (bool includeTokens, params string[] propertyKeys) + public GraphTraversal> ValueMap (bool includeTokens, params string[] propertyKeys) { - var args = new List< object >(1 + propertyKeys.Length) {includeTokens}; + var args = new List(1 + propertyKeys.Length) {includeTokens}; args.AddRange(propertyKeys); Bytecode.AddStep("valueMap", args.ToArray()); - return Wrap< S , IDictionary >(this); + return Wrap>(this); } /// /// Adds the values step to this . /// - public GraphTraversal< S , E2 > Values (params string[] propertyKeys) + public GraphTraversal Values (params string[] propertyKeys) { - var args = new List< object >(0 + propertyKeys.Length) {}; + var args = new List(0 + propertyKeys.Length) {}; args.AddRange(propertyKeys); Bytecode.AddStep("values", args.ToArray()); - return Wrap< S , E2 >(this); + return Wrap(this); } /// /// Adds the where step to this . /// - public GraphTraversal< S , E > Where (TraversalPredicate predicate) + public GraphTraversal Where (TraversalPredicate predicate) { Bytecode.AddStep("where", predicate); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the where step to this . /// - public GraphTraversal< S , E > Where (string startKey, TraversalPredicate predicate) + public GraphTraversal Where (string startKey, TraversalPredicate predicate) { Bytecode.AddStep("where", startKey, predicate); - return Wrap< S , E >(this); + return Wrap(this); } /// /// Adds the where step to this . /// - public GraphTraversal< S , E > Where (ITraversal whereTraversal) + public GraphTraversal Where (ITraversal whereTraversal) { Bytecode.AddStep("where", whereTraversal); - return Wrap< S , E >(this); + return Wrap(this); } } diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs index 880a0f5e8fd..2cbe4de47ac 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs @@ -187,10 +187,10 @@ public GraphTraversalSource WithComputer(string graphComputer = null, int? worke /// Spawns a off this graph traversal source and adds the E step to that /// traversal. /// - public GraphTraversal< Edge,Edge > E(params object[] edgesIds) + public GraphTraversal E(params object[] edgesIds) { - var traversal = new GraphTraversal< Edge,Edge >(TraversalStrategies, new Bytecode(Bytecode)); - var args = new List< object >(0 + edgesIds.Length) {}; + var traversal = new GraphTraversal(TraversalStrategies, new Bytecode(Bytecode)); + var args = new List(0 + edgesIds.Length) {}; args.AddRange(edgesIds); traversal.Bytecode.AddStep("E", args.ToArray()); return traversal; @@ -200,10 +200,10 @@ public GraphTraversal< Edge,Edge > E(params object[] edgesIds) /// Spawns a off this graph traversal source and adds the V step to that /// traversal. /// - public GraphTraversal< Vertex,Vertex > V(params object[] vertexIds) + public GraphTraversal V(params object[] vertexIds) { - var traversal = new GraphTraversal< Vertex,Vertex >(TraversalStrategies, new Bytecode(Bytecode)); - var args = new List< object >(0 + vertexIds.Length) {}; + var traversal = new GraphTraversal(TraversalStrategies, new Bytecode(Bytecode)); + var args = new List(0 + vertexIds.Length) {}; args.AddRange(vertexIds); traversal.Bytecode.AddStep("V", args.ToArray()); return traversal; @@ -213,9 +213,9 @@ public GraphTraversal< Vertex,Vertex > V(params object[] vertexIds) /// Spawns a off this graph traversal source and adds the addV step to that /// traversal. /// - public GraphTraversal< Vertex,Vertex > AddV() + public GraphTraversal AddV() { - var traversal = new GraphTraversal< Vertex,Vertex >(TraversalStrategies, new Bytecode(Bytecode)); + var traversal = new GraphTraversal(TraversalStrategies, new Bytecode(Bytecode)); traversal.Bytecode.AddStep("addV"); return traversal; } @@ -224,10 +224,10 @@ public GraphTraversal< Vertex,Vertex > AddV() /// Spawns a off this graph traversal source and adds the addV step to that /// traversal. /// - public GraphTraversal< Vertex,Vertex > AddV(params object[] keyValues) + public GraphTraversal AddV(params object[] keyValues) { - var traversal = new GraphTraversal< Vertex,Vertex >(TraversalStrategies, new Bytecode(Bytecode)); - var args = new List< object >(0 + keyValues.Length) {}; + var traversal = new GraphTraversal(TraversalStrategies, new Bytecode(Bytecode)); + var args = new List(0 + keyValues.Length) {}; args.AddRange(keyValues); traversal.Bytecode.AddStep("addV", args.ToArray()); return traversal; @@ -237,9 +237,9 @@ public GraphTraversal< Vertex,Vertex > AddV(params object[] keyValues) /// Spawns a off this graph traversal source and adds the addV step to that /// traversal. /// - public GraphTraversal< Vertex,Vertex > AddV(string label) + public GraphTraversal AddV(string label) { - var traversal = new GraphTraversal< Vertex,Vertex >(TraversalStrategies, new Bytecode(Bytecode)); + var traversal = new GraphTraversal(TraversalStrategies, new Bytecode(Bytecode)); traversal.Bytecode.AddStep("addV", label); return traversal; } @@ -248,10 +248,10 @@ public GraphTraversal< Vertex,Vertex > AddV(string label) /// Spawns a off this graph traversal source and adds the inject step to that /// traversal. /// - public GraphTraversal< S,S > Inject(params S[] starts) + public GraphTraversal Inject(params S[] starts) { - var traversal = new GraphTraversal< S,S >(TraversalStrategies, new Bytecode(Bytecode)); - var args = new List< S >(0 + starts.Length) {}; + var traversal = new GraphTraversal(TraversalStrategies, new Bytecode(Bytecode)); + var args = new List(0 + starts.Length) {}; args.AddRange(starts); traversal.Bytecode.AddStep("inject", args.ToArray()); return traversal;