http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b8a278c6/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs index 2493864..d74ee78 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs @@ -65,882 +65,1613 @@ namespace Gremlin.Net.Process.Traversal /// <summary> /// Adds the V step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Vertex > V (params object[] args) + public GraphTraversal< S , Vertex > V (params object[] vertexIdsOrElements) { - Bytecode.AddStep("V", args); + var args = new List<object> {}; + args.AddRange(vertexIdsOrElements); + Bytecode.AddStep("V", args.ToArray()); return Wrap< S , Vertex >(this); } /// <summary> /// Adds the addE step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Edge > AddE (params object[] args) + public GraphTraversal< S , Edge > AddE (Direction direction, string firstVertexKeyOrEdgeLabel, string edgeLabelOrSecondVertexKey, params object[] propertyKeyValues) { - Bytecode.AddStep("addE", args); + var args = new List<object> {direction, firstVertexKeyOrEdgeLabel, edgeLabelOrSecondVertexKey}; + args.AddRange(propertyKeyValues); + Bytecode.AddStep("addE", args.ToArray()); + return Wrap< S , Edge >(this); + } + + /// <summary> + /// Adds the addE step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , Edge > AddE (string edgeLabel) + { + Bytecode.AddStep("addE", edgeLabel); return Wrap< S , Edge >(this); } /// <summary> /// Adds the addInE step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Edge > AddInE (params object[] args) + public GraphTraversal< S , Edge > AddInE (string firstVertexKeyOrEdgeLabel, string edgeLabelOrSecondVertexKey, params object[] propertyKeyValues) { - Bytecode.AddStep("addInE", args); + var args = new List<object> {firstVertexKeyOrEdgeLabel, edgeLabelOrSecondVertexKey}; + args.AddRange(propertyKeyValues); + Bytecode.AddStep("addInE", args.ToArray()); return Wrap< S , Edge >(this); } /// <summary> /// Adds the addOutE step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Edge > AddOutE (params object[] args) + public GraphTraversal< S , Edge > AddOutE (string firstVertexKeyOrEdgeLabel, string edgeLabelOrSecondVertexKey, params object[] propertyKeyValues) { - Bytecode.AddStep("addOutE", args); + var args = new List<object> {firstVertexKeyOrEdgeLabel, edgeLabelOrSecondVertexKey}; + args.AddRange(propertyKeyValues); + Bytecode.AddStep("addOutE", args.ToArray()); return Wrap< S , Edge >(this); } /// <summary> /// Adds the addV step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Vertex > AddV (params object[] args) + public GraphTraversal< S , Vertex > AddV () + { + Bytecode.AddStep("addV"); + return Wrap< S , Vertex >(this); + } + + /// <summary> + /// Adds the addV step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , Vertex > AddV (params object[] propertyKeyValues) + { + var args = new List<object> {}; + args.AddRange(propertyKeyValues); + Bytecode.AddStep("addV", args.ToArray()); + return Wrap< S , Vertex >(this); + } + + /// <summary> + /// Adds the addV step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , Vertex > AddV (string vertexLabel) { - Bytecode.AddStep("addV", args); + Bytecode.AddStep("addV", vertexLabel); return Wrap< S , Vertex >(this); } /// <summary> /// Adds the aggregate step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Aggregate (params object[] args) + public GraphTraversal< S , E > Aggregate (string sideEffectKey) { - Bytecode.AddStep("aggregate", args); + Bytecode.AddStep("aggregate", sideEffectKey); return Wrap< S , E >(this); } /// <summary> /// Adds the and step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > And (params object[] args) + public GraphTraversal< S , E > And (params ITraversal[] andTraversals) { - Bytecode.AddStep("and", args); + var args = new List<object> {}; + args.AddRange(andTraversals); + Bytecode.AddStep("and", args.ToArray()); return Wrap< S , E >(this); } /// <summary> /// Adds the as step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > As (params object[] args) + public GraphTraversal< S , E > As (string stepLabel, params string[] stepLabels) + { + var args = new List<object> {stepLabel}; + args.AddRange(stepLabels); + Bytecode.AddStep("as", args.ToArray()); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the barrier step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Barrier () + { + Bytecode.AddStep("barrier"); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the barrier step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Barrier (object barrierConsumer) { - Bytecode.AddStep("as", args); + Bytecode.AddStep("barrier", barrierConsumer); return Wrap< S , E >(this); } /// <summary> /// Adds the barrier step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Barrier (params object[] args) + public GraphTraversal< S , E > Barrier (int maxBarrierSize) { - Bytecode.AddStep("barrier", args); + Bytecode.AddStep("barrier", maxBarrierSize); return Wrap< S , E >(this); } /// <summary> /// Adds the both step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Vertex > Both (params object[] args) + public GraphTraversal< S , Vertex > Both (params string[] edgeLabels) { - Bytecode.AddStep("both", args); + var args = new List<object> {}; + args.AddRange(edgeLabels); + Bytecode.AddStep("both", args.ToArray()); return Wrap< S , Vertex >(this); } /// <summary> /// Adds the bothE step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Edge > BothE (params object[] args) + public GraphTraversal< S , Edge > BothE (params string[] edgeLabels) { - Bytecode.AddStep("bothE", args); + var args = new List<object> {}; + args.AddRange(edgeLabels); + Bytecode.AddStep("bothE", args.ToArray()); return Wrap< S , Edge >(this); } /// <summary> /// Adds the bothV step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Vertex > BothV (params object[] args) + public GraphTraversal< S , Vertex > BothV () { - Bytecode.AddStep("bothV", args); + Bytecode.AddStep("bothV"); return Wrap< S , Vertex >(this); } /// <summary> /// Adds the branch step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Branch<E2> (params object[] args) + public GraphTraversal< S , E2 > Branch<E2> (object function) + { + Bytecode.AddStep("branch", function); + return Wrap< S , E2 >(this); + } + + /// <summary> + /// Adds the branch step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E2 > Branch<E2> (ITraversal branchTraversal) { - Bytecode.AddStep("branch", args); + Bytecode.AddStep("branch", branchTraversal); return Wrap< S , E2 >(this); } /// <summary> /// Adds the by step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > By (params object[] args) + public GraphTraversal< S , E > By () + { + Bytecode.AddStep("by"); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the by step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > By (object comparator) + { + Bytecode.AddStep("by", comparator); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the by step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > By (object function, object comparator) { - Bytecode.AddStep("by", args); + Bytecode.AddStep("by", function, comparator); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the by step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > By (Order order) + { + Bytecode.AddStep("by", order); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the by step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > By (string key) + { + Bytecode.AddStep("by", key); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the by step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > By (string key, object comparator) + { + Bytecode.AddStep("by", key, comparator); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the by step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > By (T token) + { + Bytecode.AddStep("by", token); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the by step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > By (ITraversal traversal) + { + Bytecode.AddStep("by", traversal); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the by step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > By (ITraversal traversal, object comparator) + { + Bytecode.AddStep("by", traversal, comparator); return Wrap< S , E >(this); } /// <summary> /// Adds the cap step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Cap<E2> (params object[] args) + public GraphTraversal< S , E2 > Cap<E2> (string sideEffectKey, params string[] sideEffectKeys) + { + var args = new List<object> {sideEffectKey}; + args.AddRange(sideEffectKeys); + Bytecode.AddStep("cap", args.ToArray()); + return Wrap< S , E2 >(this); + } + + /// <summary> + /// Adds the choose step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E2 > Choose<E2> (object choiceFunction) + { + Bytecode.AddStep("choose", choiceFunction); + return Wrap< S , E2 >(this); + } + + /// <summary> + /// Adds the choose step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E2 > Choose<E2> (TraversalPredicate choosePredicate, ITraversal trueChoice) { - Bytecode.AddStep("cap", args); + Bytecode.AddStep("choose", choosePredicate, trueChoice); return Wrap< S , E2 >(this); } /// <summary> /// Adds the choose step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Choose<E2> (params object[] args) + public GraphTraversal< S , E2 > Choose<E2> (TraversalPredicate choosePredicate, ITraversal trueChoice, ITraversal falseChoice) { - Bytecode.AddStep("choose", args); + Bytecode.AddStep("choose", choosePredicate, trueChoice, falseChoice); + return Wrap< S , E2 >(this); + } + + /// <summary> + /// Adds the choose step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E2 > Choose<E2> (ITraversal choiceTraversal) + { + Bytecode.AddStep("choose", choiceTraversal); + return Wrap< S , E2 >(this); + } + + /// <summary> + /// Adds the choose step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E2 > Choose<E2> (ITraversal traversalPredicate, ITraversal trueChoice) + { + Bytecode.AddStep("choose", traversalPredicate, trueChoice); + return Wrap< S , E2 >(this); + } + + /// <summary> + /// Adds the choose step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E2 > Choose<E2> (ITraversal traversalPredicate, ITraversal trueChoice, ITraversal falseChoice) + { + Bytecode.AddStep("choose", traversalPredicate, trueChoice, falseChoice); return Wrap< S , E2 >(this); } /// <summary> /// Adds the coalesce step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Coalesce<E2> (params object[] args) + public GraphTraversal< S , E2 > Coalesce<E2> (params ITraversal[] coalesceTraversals) { - Bytecode.AddStep("coalesce", args); + var args = new List<object> {}; + args.AddRange(coalesceTraversals); + Bytecode.AddStep("coalesce", args.ToArray()); return Wrap< S , E2 >(this); } /// <summary> /// Adds the coin step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Coin (params object[] args) + public GraphTraversal< S , E > Coin (double probability) { - Bytecode.AddStep("coin", args); + Bytecode.AddStep("coin", probability); return Wrap< S , E >(this); } /// <summary> /// Adds the constant step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Constant<E2> (params object[] args) + public GraphTraversal< S , E2 > Constant<E2> (object e) { - Bytecode.AddStep("constant", args); + Bytecode.AddStep("constant", e); return Wrap< S , E2 >(this); } /// <summary> /// Adds the count step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , long > Count (params object[] args) + public GraphTraversal< S , long > Count () + { + Bytecode.AddStep("count"); + return Wrap< S , long >(this); + } + + /// <summary> + /// Adds the count step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , long > Count (Scope scope) { - Bytecode.AddStep("count", args); + Bytecode.AddStep("count", scope); return Wrap< S , long >(this); } /// <summary> /// Adds the cyclicPath step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > CyclicPath (params object[] args) + public GraphTraversal< S , E > CyclicPath () + { + Bytecode.AddStep("cyclicPath"); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the dedup step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Dedup (Scope scope, params string[] dedupLabels) { - Bytecode.AddStep("cyclicPath", args); + var args = new List<object> {scope}; + args.AddRange(dedupLabels); + Bytecode.AddStep("dedup", args.ToArray()); return Wrap< S , E >(this); } /// <summary> /// Adds the dedup step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Dedup (params object[] args) + public GraphTraversal< S , E > Dedup (params string[] dedupLabels) { - Bytecode.AddStep("dedup", args); + var args = new List<object> {}; + args.AddRange(dedupLabels); + Bytecode.AddStep("dedup", args.ToArray()); return Wrap< S , E >(this); } /// <summary> /// Adds the drop step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Drop (params object[] args) + public GraphTraversal< S , E > Drop () + { + Bytecode.AddStep("drop"); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the emit step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Emit () { - Bytecode.AddStep("drop", args); + Bytecode.AddStep("emit"); return Wrap< S , E >(this); } /// <summary> /// Adds the emit step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Emit (params object[] args) + public GraphTraversal< S , E > Emit (TraversalPredicate emitPredicate) { - Bytecode.AddStep("emit", args); + Bytecode.AddStep("emit", emitPredicate); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the emit step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Emit (ITraversal emitTraversal) + { + Bytecode.AddStep("emit", emitTraversal); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the filter step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Filter (TraversalPredicate predicate) + { + Bytecode.AddStep("filter", predicate); return Wrap< S , E >(this); } /// <summary> /// Adds the filter step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Filter (params object[] args) + public GraphTraversal< S , E > Filter (ITraversal filterTraversal) { - Bytecode.AddStep("filter", args); + Bytecode.AddStep("filter", filterTraversal); return Wrap< S , E >(this); } /// <summary> /// Adds the flatMap step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > FlatMap<E2> (params object[] args) + public GraphTraversal< S , E2 > FlatMap<E2> (object function) + { + Bytecode.AddStep("flatMap", function); + return Wrap< S , E2 >(this); + } + + /// <summary> + /// Adds the flatMap step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E2 > FlatMap<E2> (ITraversal flatMapTraversal) { - Bytecode.AddStep("flatMap", args); + Bytecode.AddStep("flatMap", flatMapTraversal); return Wrap< S , E2 >(this); } /// <summary> /// Adds the fold step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Fold<E2> (params object[] args) + public GraphTraversal< S , IList<E> > Fold () { - Bytecode.AddStep("fold", args); + Bytecode.AddStep("fold"); + return Wrap< S , IList<E> >(this); + } + + /// <summary> + /// Adds the fold step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E2 > Fold<E2> (object seed, object foldFunction) + { + Bytecode.AddStep("fold", seed, foldFunction); return Wrap< S , E2 >(this); } /// <summary> /// Adds the from step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > From (params object[] args) + public GraphTraversal< S , E > From (string fromStepLabel) { - Bytecode.AddStep("from", args); + Bytecode.AddStep("from", fromStepLabel); return Wrap< S , E >(this); } /// <summary> + /// Adds the from step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > From (ITraversal fromVertex) + { + Bytecode.AddStep("from", fromVertex); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the group step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , IDictionary<K, V> > Group<K, V> () + { + Bytecode.AddStep("group"); + return Wrap< S , IDictionary<K, V> >(this); + } + + /// <summary> /// Adds the group step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Group (params object[] args) + public GraphTraversal< S , E > Group (string sideEffectKey) { - Bytecode.AddStep("group", args); + Bytecode.AddStep("group", sideEffectKey); return Wrap< S , E >(this); } /// <summary> /// Adds the groupCount step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > GroupCount (params object[] args) + public GraphTraversal< S , IDictionary<K, long> > GroupCount<K> () + { + Bytecode.AddStep("groupCount"); + return Wrap< S , IDictionary<K, long> >(this); + } + + /// <summary> + /// Adds the groupCount step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > GroupCount (string sideEffectKey) { - Bytecode.AddStep("groupCount", args); + Bytecode.AddStep("groupCount", sideEffectKey); return Wrap< S , E >(this); } /// <summary> /// Adds the groupV3d0 step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > GroupV3d0 (params object[] args) + public GraphTraversal< S , IDictionary<K, V> > GroupV3d0<K, V> () + { + Bytecode.AddStep("groupV3d0"); + return Wrap< S , IDictionary<K, V> >(this); + } + + /// <summary> + /// Adds the groupV3d0 step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > GroupV3d0 (string sideEffectKey) + { + Bytecode.AddStep("groupV3d0", sideEffectKey); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the has step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Has (string propertyKey) + { + Bytecode.AddStep("has", propertyKey); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the has step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Has (string propertyKey, object value) + { + Bytecode.AddStep("has", propertyKey, value); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the has step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Has (string propertyKey, TraversalPredicate predicate) + { + Bytecode.AddStep("has", propertyKey, predicate); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the has step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Has (string label, string propertyKey, object value) + { + Bytecode.AddStep("has", label, propertyKey, value); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the has step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Has (string label, string propertyKey, TraversalPredicate predicate) + { + Bytecode.AddStep("has", label, propertyKey, predicate); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the has step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Has (string propertyKey, ITraversal propertyTraversal) + { + Bytecode.AddStep("has", propertyKey, propertyTraversal); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the has step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Has (T accessor, object value) + { + Bytecode.AddStep("has", accessor, value); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the has step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Has (T accessor, TraversalPredicate predicate) { - Bytecode.AddStep("groupV3d0", args); + Bytecode.AddStep("has", accessor, predicate); return Wrap< S , E >(this); } /// <summary> /// Adds the has step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Has (params object[] args) + public GraphTraversal< S , E > Has (T accessor, ITraversal propertyTraversal) + { + Bytecode.AddStep("has", accessor, propertyTraversal); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the hasId step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > HasId (object id, params object[] otherIds) { - Bytecode.AddStep("has", args); + var args = new List<object> {id}; + args.AddRange(otherIds); + Bytecode.AddStep("hasId", args.ToArray()); return Wrap< S , E >(this); } /// <summary> /// Adds the hasId step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > HasId (params object[] args) + public GraphTraversal< S , E > HasId (TraversalPredicate predicate) { - Bytecode.AddStep("hasId", args); + Bytecode.AddStep("hasId", predicate); return Wrap< S , E >(this); } /// <summary> /// Adds the hasKey step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > HasKey (params object[] args) + public GraphTraversal< S , E > HasKey (TraversalPredicate predicate) { - Bytecode.AddStep("hasKey", args); + Bytecode.AddStep("hasKey", predicate); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the hasKey step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > HasKey (string label, params string[] otherLabels) + { + var args = new List<object> {label}; + args.AddRange(otherLabels); + Bytecode.AddStep("hasKey", args.ToArray()); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the hasLabel step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > HasLabel (TraversalPredicate predicate) + { + Bytecode.AddStep("hasLabel", predicate); return Wrap< S , E >(this); } /// <summary> /// Adds the hasLabel step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > HasLabel (params object[] args) + public GraphTraversal< S , E > HasLabel (string label, params string[] otherLabels) { - Bytecode.AddStep("hasLabel", args); + var args = new List<object> {label}; + args.AddRange(otherLabels); + Bytecode.AddStep("hasLabel", args.ToArray()); return Wrap< S , E >(this); } /// <summary> /// Adds the hasNot step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > HasNot (params object[] args) + public GraphTraversal< S , E > HasNot (string propertyKey) + { + Bytecode.AddStep("hasNot", propertyKey); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the hasValue step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > HasValue (object value, params object[] otherValues) { - Bytecode.AddStep("hasNot", args); + var args = new List<object> {value}; + args.AddRange(otherValues); + Bytecode.AddStep("hasValue", args.ToArray()); return Wrap< S , E >(this); } /// <summary> /// Adds the hasValue step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > HasValue (params object[] args) + public GraphTraversal< S , E > HasValue (TraversalPredicate predicate) { - Bytecode.AddStep("hasValue", args); + Bytecode.AddStep("hasValue", predicate); return Wrap< S , E >(this); } /// <summary> /// Adds the id step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , object > Id (params object[] args) + public GraphTraversal< S , object > Id () { - Bytecode.AddStep("id", args); + Bytecode.AddStep("id"); return Wrap< S , object >(this); } /// <summary> /// Adds the identity step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Identity (params object[] args) + public GraphTraversal< S , E > Identity () { - Bytecode.AddStep("identity", args); + Bytecode.AddStep("identity"); return Wrap< S , E >(this); } /// <summary> /// Adds the in step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Vertex > In (params object[] args) + public GraphTraversal< S , Vertex > In (params string[] edgeLabels) { - Bytecode.AddStep("in", args); + var args = new List<object> {}; + args.AddRange(edgeLabels); + Bytecode.AddStep("in", args.ToArray()); return Wrap< S , Vertex >(this); } /// <summary> /// Adds the inE step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Edge > InE (params object[] args) + public GraphTraversal< S , Edge > InE (params string[] edgeLabels) { - Bytecode.AddStep("inE", args); + var args = new List<object> {}; + args.AddRange(edgeLabels); + Bytecode.AddStep("inE", args.ToArray()); return Wrap< S , Edge >(this); } /// <summary> /// Adds the inV step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Vertex > InV (params object[] args) + public GraphTraversal< S , Vertex > InV () { - Bytecode.AddStep("inV", args); + Bytecode.AddStep("inV"); return Wrap< S , Vertex >(this); } /// <summary> /// Adds the inject step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Inject (params object[] args) + public GraphTraversal< S , E > Inject (params object[] injections) + { + var args = new List<object> {}; + args.AddRange(injections); + Bytecode.AddStep("inject", args.ToArray()); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the is step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Is (object value) { - Bytecode.AddStep("inject", args); + Bytecode.AddStep("is", value); return Wrap< S , E >(this); } /// <summary> /// Adds the is step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Is (params object[] args) + public GraphTraversal< S , E > Is (TraversalPredicate predicate) { - Bytecode.AddStep("is", args); + Bytecode.AddStep("is", predicate); return Wrap< S , E >(this); } /// <summary> /// Adds the key step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , string > Key (params object[] args) + public GraphTraversal< S , string > Key () { - Bytecode.AddStep("key", args); + Bytecode.AddStep("key"); return Wrap< S , string >(this); } /// <summary> /// Adds the label step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , string > Label (params object[] args) + public GraphTraversal< S , string > Label () { - Bytecode.AddStep("label", args); + Bytecode.AddStep("label"); return Wrap< S , string >(this); } /// <summary> /// Adds the limit step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Limit<E2> (params object[] args) + public GraphTraversal< S , E2 > Limit<E2> (Scope scope, long limit) { - Bytecode.AddStep("limit", args); + Bytecode.AddStep("limit", scope, limit); return Wrap< S , E2 >(this); } /// <summary> + /// Adds the limit step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Limit (long limit) + { + Bytecode.AddStep("limit", limit); + return Wrap< S , E >(this); + } + + /// <summary> /// Adds the local step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Local<E2> (params object[] args) + public GraphTraversal< S , E2 > Local<E2> (ITraversal localTraversal) { - Bytecode.AddStep("local", args); + Bytecode.AddStep("local", localTraversal); return Wrap< S , E2 >(this); } /// <summary> /// Adds the loops step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , int > Loops (params object[] args) + public GraphTraversal< S , int > Loops () { - Bytecode.AddStep("loops", args); + Bytecode.AddStep("loops"); return Wrap< S , int >(this); } /// <summary> /// Adds the map step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Map<E2> (params object[] args) + public GraphTraversal< S , E2 > Map<E2> (object function) + { + Bytecode.AddStep("map", function); + return Wrap< S , E2 >(this); + } + + /// <summary> + /// Adds the map step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E2 > Map<E2> (ITraversal mapTraversal) { - Bytecode.AddStep("map", args); + Bytecode.AddStep("map", mapTraversal); return Wrap< S , E2 >(this); } /// <summary> /// Adds the mapKeys step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > MapKeys<E2> (params object[] args) + public GraphTraversal< S , E2 > MapKeys<E2> () { - Bytecode.AddStep("mapKeys", args); + Bytecode.AddStep("mapKeys"); return Wrap< S , E2 >(this); } /// <summary> /// Adds the mapValues step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > MapValues<E2> (params object[] args) + public GraphTraversal< S , E2 > MapValues<E2> () { - Bytecode.AddStep("mapValues", args); + Bytecode.AddStep("mapValues"); return Wrap< S , E2 >(this); } /// <summary> /// Adds the match step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , IDictionary<string, E2> > Match<E2> (params object[] args) + public GraphTraversal< S , IDictionary<string, E2> > Match<E2> (params ITraversal[] matchTraversals) { - Bytecode.AddStep("match", args); + var args = new List<object> {}; + args.AddRange(matchTraversals); + Bytecode.AddStep("match", args.ToArray()); return Wrap< S , IDictionary<string, E2> >(this); } /// <summary> /// Adds the max step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Max<E2> (params object[] args) + public GraphTraversal< S , E2 > Max<E2> () { - Bytecode.AddStep("max", args); + Bytecode.AddStep("max"); + return Wrap< S , E2 >(this); + } + + /// <summary> + /// Adds the max step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E2 > Max<E2> (Scope scope) + { + Bytecode.AddStep("max", scope); + return Wrap< S , E2 >(this); + } + + /// <summary> + /// Adds the mean step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E2 > Mean<E2> () + { + Bytecode.AddStep("mean"); return Wrap< S , E2 >(this); } /// <summary> /// Adds the mean step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Mean<E2> (params object[] args) + public GraphTraversal< S , E2 > Mean<E2> (Scope scope) { - Bytecode.AddStep("mean", args); + Bytecode.AddStep("mean", scope); return Wrap< S , E2 >(this); } /// <summary> /// Adds the min step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Min<E2> (params object[] args) + public GraphTraversal< S , E2 > Min<E2> () { - Bytecode.AddStep("min", args); + Bytecode.AddStep("min"); + return Wrap< S , E2 >(this); + } + + /// <summary> + /// Adds the min step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E2 > Min<E2> (Scope scope) + { + Bytecode.AddStep("min", scope); return Wrap< S , E2 >(this); } /// <summary> /// Adds the not step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Not (params object[] args) + public GraphTraversal< S , E > Not (ITraversal notTraversal) + { + Bytecode.AddStep("not", notTraversal); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the option step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Option (object pickToken, ITraversal traversalOption) { - Bytecode.AddStep("not", args); + Bytecode.AddStep("option", pickToken, traversalOption); return Wrap< S , E >(this); } /// <summary> /// Adds the option step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Option (params object[] args) + public GraphTraversal< S , E > Option (ITraversal traversalOption) { - Bytecode.AddStep("option", args); + Bytecode.AddStep("option", traversalOption); return Wrap< S , E >(this); } /// <summary> /// Adds the optional step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Optional<E2> (params object[] args) + public GraphTraversal< S , E2 > Optional<E2> (ITraversal optionalTraversal) { - Bytecode.AddStep("optional", args); + Bytecode.AddStep("optional", optionalTraversal); return Wrap< S , E2 >(this); } /// <summary> /// Adds the or step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Or (params object[] args) + public GraphTraversal< S , E > Or (params ITraversal[] orTraversals) + { + var args = new List<object> {}; + args.AddRange(orTraversals); + Bytecode.AddStep("or", args.ToArray()); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the order step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Order () { - Bytecode.AddStep("or", args); + Bytecode.AddStep("order"); return Wrap< S , E >(this); } /// <summary> /// Adds the order step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Order (params object[] args) + public GraphTraversal< S , E > Order (Scope scope) { - Bytecode.AddStep("order", args); + Bytecode.AddStep("order", scope); return Wrap< S , E >(this); } /// <summary> /// Adds the otherV step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Vertex > OtherV (params object[] args) + public GraphTraversal< S , Vertex > OtherV () { - Bytecode.AddStep("otherV", args); + Bytecode.AddStep("otherV"); return Wrap< S , Vertex >(this); } /// <summary> /// Adds the out step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Vertex > Out (params object[] args) + public GraphTraversal< S , Vertex > Out (params string[] edgeLabels) { - Bytecode.AddStep("out", args); + var args = new List<object> {}; + args.AddRange(edgeLabels); + Bytecode.AddStep("out", args.ToArray()); return Wrap< S , Vertex >(this); } /// <summary> /// Adds the outE step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Edge > OutE (params object[] args) + public GraphTraversal< S , Edge > OutE (params string[] edgeLabels) { - Bytecode.AddStep("outE", args); + var args = new List<object> {}; + args.AddRange(edgeLabels); + Bytecode.AddStep("outE", args.ToArray()); return Wrap< S , Edge >(this); } /// <summary> /// Adds the outV step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Vertex > OutV (params object[] args) + public GraphTraversal< S , Vertex > OutV () { - Bytecode.AddStep("outV", args); + Bytecode.AddStep("outV"); return Wrap< S , Vertex >(this); } /// <summary> /// Adds the pageRank step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > PageRank (params object[] args) + public GraphTraversal< S , E > PageRank () { - Bytecode.AddStep("pageRank", args); + Bytecode.AddStep("pageRank"); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the pageRank step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > PageRank (double alpha) + { + Bytecode.AddStep("pageRank", alpha); return Wrap< S , E >(this); } /// <summary> /// Adds the path step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Path > Path (params object[] args) + public GraphTraversal< S , Path > Path () { - Bytecode.AddStep("path", args); + Bytecode.AddStep("path"); return Wrap< S , Path >(this); } /// <summary> /// Adds the peerPressure step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > PeerPressure (params object[] args) + public GraphTraversal< S , E > PeerPressure () { - Bytecode.AddStep("peerPressure", args); + Bytecode.AddStep("peerPressure"); return Wrap< S , E >(this); } /// <summary> /// Adds the profile step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Profile (params object[] args) + public GraphTraversal< S , E2 > Profile<E2> () + { + Bytecode.AddStep("profile"); + return Wrap< S , E2 >(this); + } + + /// <summary> + /// Adds the profile step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Profile (string sideEffectKey) { - Bytecode.AddStep("profile", args); + Bytecode.AddStep("profile", sideEffectKey); return Wrap< S , E >(this); } /// <summary> /// Adds the program step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Program (params object[] args) + public GraphTraversal< S , E > Program (object vertexProgram) { - Bytecode.AddStep("program", args); + Bytecode.AddStep("program", vertexProgram); return Wrap< S , E >(this); } /// <summary> /// Adds the project step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , IDictionary<string, E2> > Project<E2> (params object[] args) + public GraphTraversal< S , IDictionary<string, E2> > Project<E2> (string projectKey, params string[] otherProjectKeys) { - Bytecode.AddStep("project", args); + var args = new List<object> {projectKey}; + args.AddRange(otherProjectKeys); + Bytecode.AddStep("project", args.ToArray()); return Wrap< S , IDictionary<string, E2> >(this); } /// <summary> /// Adds the properties step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Properties<E2> (params object[] args) + public GraphTraversal< S , E2 > Properties<E2> (params string[] propertyKeys) { - Bytecode.AddStep("properties", args); + var args = new List<object> {}; + args.AddRange(propertyKeys); + Bytecode.AddStep("properties", args.ToArray()); return Wrap< S , E2 >(this); } /// <summary> /// Adds the property step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Property (params object[] args) + public GraphTraversal< S , E > Property (Cardinality cardinality, object key, object value, params object[] keyValues) { - Bytecode.AddStep("property", args); + var args = new List<object> {cardinality, key, value}; + args.AddRange(keyValues); + Bytecode.AddStep("property", args.ToArray()); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the property step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Property (object key, object value, params object[] keyValues) + { + var args = new List<object> {key, value}; + args.AddRange(keyValues); + Bytecode.AddStep("property", args.ToArray()); return Wrap< S , E >(this); } /// <summary> /// Adds the propertyMap step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , IDictionary<string, E2> > PropertyMap<E2> (params object[] args) + public GraphTraversal< S , IDictionary<string, E2> > PropertyMap<E2> (params string[] propertyKeys) { - Bytecode.AddStep("propertyMap", args); + var args = new List<object> {}; + args.AddRange(propertyKeys); + Bytecode.AddStep("propertyMap", args.ToArray()); return Wrap< S , IDictionary<string, E2> >(this); } /// <summary> /// Adds the range step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Range<E2> (params object[] args) + public GraphTraversal< S , E2 > Range<E2> (Scope scope, long low, long high) { - Bytecode.AddStep("range", args); + Bytecode.AddStep("range", scope, low, high); return Wrap< S , E2 >(this); } /// <summary> + /// Adds the range step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Range (long low, long high) + { + Bytecode.AddStep("range", low, high); + return Wrap< S , E >(this); + } + + /// <summary> /// Adds the repeat step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Repeat (params object[] args) + public GraphTraversal< S , E > Repeat (ITraversal repeatTraversal) { - Bytecode.AddStep("repeat", args); + Bytecode.AddStep("repeat", repeatTraversal); return Wrap< S , E >(this); } /// <summary> /// Adds the sack step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Sack (params object[] args) + public GraphTraversal< S , E2 > Sack<E2> () { - Bytecode.AddStep("sack", args); + Bytecode.AddStep("sack"); + return Wrap< S , E2 >(this); + } + + /// <summary> + /// Adds the sack step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Sack (object sackOperator) + { + Bytecode.AddStep("sack", sackOperator); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the sack step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Sack (object sackOperator, string elementPropertyKey) + { + Bytecode.AddStep("sack", sackOperator, elementPropertyKey); return Wrap< S , E >(this); } /// <summary> /// Adds the sample step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Sample (params object[] args) + public GraphTraversal< S , E > Sample (Scope scope, int amountToSample) { - Bytecode.AddStep("sample", args); + Bytecode.AddStep("sample", scope, amountToSample); return Wrap< S , E >(this); } /// <summary> + /// Adds the sample step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Sample (int amountToSample) + { + Bytecode.AddStep("sample", amountToSample); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the select step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , ICollection<E2> > Select<E2> (Column column) + { + Bytecode.AddStep("select", column); + return Wrap< S , ICollection<E2> >(this); + } + + /// <summary> + /// Adds the select step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E2 > Select<E2> (Pop pop, string selectKey) + { + Bytecode.AddStep("select", pop, selectKey); + return Wrap< S , E2 >(this); + } + + /// <summary> /// Adds the select step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , IDictionary<string, E2> > Select<E2> (params object[] args) + public GraphTraversal< S , IDictionary<string, E2> > Select<E2> (Pop pop, string selectKey1, string selectKey2, params string[] otherSelectKeys) { - Bytecode.AddStep("select", args); + var args = new List<object> {pop, selectKey1, selectKey2}; + args.AddRange(otherSelectKeys); + Bytecode.AddStep("select", args.ToArray()); + return Wrap< S , IDictionary<string, E2> >(this); + } + + /// <summary> + /// Adds the select step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E2 > Select<E2> (string selectKey) + { + Bytecode.AddStep("select", selectKey); + return Wrap< S , E2 >(this); + } + + /// <summary> + /// Adds the select step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , IDictionary<string, E2> > Select<E2> (string selectKey1, string selectKey2, params string[] otherSelectKeys) + { + var args = new List<object> {selectKey1, selectKey2}; + args.AddRange(otherSelectKeys); + Bytecode.AddStep("select", args.ToArray()); return Wrap< S , IDictionary<string, E2> >(this); } /// <summary> /// Adds the sideEffect step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > SideEffect (params object[] args) + public GraphTraversal< S , E > SideEffect (object consumer) { - Bytecode.AddStep("sideEffect", args); + Bytecode.AddStep("sideEffect", consumer); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the sideEffect step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > SideEffect (ITraversal sideEffectTraversal) + { + Bytecode.AddStep("sideEffect", sideEffectTraversal); return Wrap< S , E >(this); } /// <summary> /// Adds the simplePath step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > SimplePath (params object[] args) + public GraphTraversal< S , E > SimplePath () { - Bytecode.AddStep("simplePath", args); + Bytecode.AddStep("simplePath"); return Wrap< S , E >(this); } /// <summary> /// Adds the store step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Store (params object[] args) + public GraphTraversal< S , E > Store (string sideEffectKey) { - Bytecode.AddStep("store", args); + Bytecode.AddStep("store", sideEffectKey); return Wrap< S , E >(this); } /// <summary> /// Adds the subgraph step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Edge > Subgraph (params object[] args) + public GraphTraversal< S , Edge > Subgraph (string sideEffectKey) { - Bytecode.AddStep("subgraph", args); + Bytecode.AddStep("subgraph", sideEffectKey); return Wrap< S , Edge >(this); } /// <summary> /// Adds the sum step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Sum<E2> (params object[] args) + public GraphTraversal< S , E2 > Sum<E2> () + { + Bytecode.AddStep("sum"); + return Wrap< S , E2 >(this); + } + + /// <summary> + /// Adds the sum step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E2 > Sum<E2> (Scope scope) + { + Bytecode.AddStep("sum", scope); + return Wrap< S , E2 >(this); + } + + /// <summary> + /// Adds the tail step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Tail () { - Bytecode.AddStep("sum", args); + Bytecode.AddStep("tail"); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the tail step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E2 > Tail<E2> (Scope scope) + { + Bytecode.AddStep("tail", scope); return Wrap< S , E2 >(this); } /// <summary> /// Adds the tail step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Tail<E2> (params object[] args) + public GraphTraversal< S , E2 > Tail<E2> (Scope scope, long limit) { - Bytecode.AddStep("tail", args); + Bytecode.AddStep("tail", scope, limit); return Wrap< S , E2 >(this); } /// <summary> + /// Adds the tail step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Tail (long limit) + { + Bytecode.AddStep("tail", limit); + return Wrap< S , E >(this); + } + + /// <summary> /// Adds the timeLimit step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > TimeLimit (params object[] args) + public GraphTraversal< S , E > TimeLimit (long timeLimit) { - Bytecode.AddStep("timeLimit", args); + Bytecode.AddStep("timeLimit", timeLimit); return Wrap< S , E >(this); } /// <summary> /// Adds the times step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Times (params object[] args) + public GraphTraversal< S , E > Times (int maxLoops) { - Bytecode.AddStep("times", args); + Bytecode.AddStep("times", maxLoops); return Wrap< S , E >(this); } /// <summary> /// Adds the to step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Vertex > To (params object[] args) + public GraphTraversal< S , Vertex > To (Direction direction, params string[] edgeLabels) { - Bytecode.AddStep("to", args); + var args = new List<object> {direction}; + args.AddRange(edgeLabels); + Bytecode.AddStep("to", args.ToArray()); return Wrap< S , Vertex >(this); } /// <summary> + /// Adds the to step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > To (string toStepLabel) + { + Bytecode.AddStep("to", toStepLabel); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the to step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > To (ITraversal toVertex) + { + Bytecode.AddStep("to", toVertex); + return Wrap< S , E >(this); + } + + /// <summary> /// Adds the toE step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Edge > ToE (params object[] args) + public GraphTraversal< S , Edge > ToE (Direction direction, params string[] edgeLabels) { - Bytecode.AddStep("toE", args); + var args = new List<object> {direction}; + args.AddRange(edgeLabels); + Bytecode.AddStep("toE", args.ToArray()); return Wrap< S , Edge >(this); } /// <summary> /// Adds the toV step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , Vertex > ToV (params object[] args) + public GraphTraversal< S , Vertex > ToV (Direction direction) { - Bytecode.AddStep("toV", args); + Bytecode.AddStep("toV", direction); return Wrap< S , Vertex >(this); } /// <summary> /// Adds the tree step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Tree (params object[] args) + public GraphTraversal< S , E2 > Tree<E2> () { - Bytecode.AddStep("tree", args); + Bytecode.AddStep("tree"); + return Wrap< S , E2 >(this); + } + + /// <summary> + /// Adds the tree step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Tree (string sideEffectKey) + { + Bytecode.AddStep("tree", sideEffectKey); return Wrap< S , E >(this); } /// <summary> /// Adds the unfold step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Unfold<E2> (params object[] args) + public GraphTraversal< S , E2 > Unfold<E2> () { - Bytecode.AddStep("unfold", args); + Bytecode.AddStep("unfold"); return Wrap< S , E2 >(this); } /// <summary> /// Adds the union step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Union<E2> (params object[] args) + public GraphTraversal< S , E2 > Union<E2> (params ITraversal[] unionTraversals) { - Bytecode.AddStep("union", args); + var args = new List<object> {}; + args.AddRange(unionTraversals); + Bytecode.AddStep("union", args.ToArray()); return Wrap< S , E2 >(this); } /// <summary> /// Adds the until step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Until (params object[] args) + public GraphTraversal< S , E > Until (TraversalPredicate untilPredicate) + { + Bytecode.AddStep("until", untilPredicate); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the until step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Until (ITraversal untilTraversal) { - Bytecode.AddStep("until", args); + Bytecode.AddStep("until", untilTraversal); return Wrap< S , E >(this); } /// <summary> /// Adds the value step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Value<E2> (params object[] args) + public GraphTraversal< S , E2 > Value<E2> () { - Bytecode.AddStep("value", args); + Bytecode.AddStep("value"); return Wrap< S , E2 >(this); } /// <summary> /// Adds the valueMap step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , IDictionary<string, E2> > ValueMap<E2> (params object[] args) + public GraphTraversal< S , IDictionary<string, E2> > ValueMap<E2> (params string[] propertyKeys) { - Bytecode.AddStep("valueMap", args); + var args = new List<object> {}; + args.AddRange(propertyKeys); + Bytecode.AddStep("valueMap", args.ToArray()); + return Wrap< S , IDictionary<string, E2> >(this); + } + + /// <summary> + /// Adds the valueMap step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , IDictionary<string, E2> > ValueMap<E2> (bool includeTokens, params string[] propertyKeys) + { + var args = new List<object> {includeTokens}; + args.AddRange(propertyKeys); + Bytecode.AddStep("valueMap", args.ToArray()); return Wrap< S , IDictionary<string, E2> >(this); } /// <summary> /// Adds the values step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E2 > Values<E2> (params object[] args) + public GraphTraversal< S , E2 > Values<E2> (params string[] propertyKeys) { - Bytecode.AddStep("values", args); + var args = new List<object> {}; + args.AddRange(propertyKeys); + Bytecode.AddStep("values", args.ToArray()); return Wrap< S , E2 >(this); } /// <summary> /// Adds the where step to this <see cref="GraphTraversal{SType, EType}" />. /// </summary> - public GraphTraversal< S , E > Where (params object[] args) + public GraphTraversal< S , E > Where (TraversalPredicate predicate) + { + Bytecode.AddStep("where", predicate); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the where step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Where (string startKey, TraversalPredicate predicate) + { + Bytecode.AddStep("where", startKey, predicate); + return Wrap< S , E >(this); + } + + /// <summary> + /// Adds the where step to this <see cref="GraphTraversal{SType, EType}" />. + /// </summary> + public GraphTraversal< S , E > Where (ITraversal whereTraversal) { - Bytecode.AddStep("where", args); + Bytecode.AddStep("where", whereTraversal); return Wrap< S , E >(this); }
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b8a278c6/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs index e0cd25a..40be304 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversalSource.cs @@ -72,51 +72,79 @@ namespace Gremlin.Net.Process.Traversal } - public GraphTraversalSource WithBulk(params object[] args) + public GraphTraversalSource WithBulk(bool useBulk) { var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies), new Bytecode(Bytecode)); - source.Bytecode.AddSource("withBulk", args); + source.Bytecode.AddSource("withBulk", useBulk); return source; } - public GraphTraversalSource WithPath(params object[] args) + public GraphTraversalSource WithPath() { var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies), new Bytecode(Bytecode)); - source.Bytecode.AddSource("withPath", args); + source.Bytecode.AddSource("withPath"); return source; } - public GraphTraversalSource WithSack(params object[] args) + public GraphTraversalSource WithSack(object initialValue) { var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies), new Bytecode(Bytecode)); - source.Bytecode.AddSource("withSack", args); + source.Bytecode.AddSource("withSack", initialValue); return source; } - public GraphTraversalSource WithSideEffect(params object[] args) + public GraphTraversalSource WithSack(object initialValue, object mergeOperator) { var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies), new Bytecode(Bytecode)); - source.Bytecode.AddSource("withSideEffect", args); + source.Bytecode.AddSource("withSack", initialValue, mergeOperator); return source; } - public GraphTraversalSource WithStrategies(params object[] args) + public GraphTraversalSource WithSack(object initialValue, object splitOperator, object mergeOperator) { var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies), new Bytecode(Bytecode)); - source.Bytecode.AddSource("withStrategies", args); + source.Bytecode.AddSource("withSack", initialValue, splitOperator, mergeOperator); return source; } - public GraphTraversalSource WithoutStrategies(params object[] args) + public GraphTraversalSource WithSideEffect(string key, object initialValue) { var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies), new Bytecode(Bytecode)); - source.Bytecode.AddSource("withoutStrategies", args); + source.Bytecode.AddSource("withSideEffect", key, initialValue); + return source; + } + + public GraphTraversalSource WithSideEffect(string key, object initialValue, object reducer) + { + var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies), + new Bytecode(Bytecode)); + source.Bytecode.AddSource("withSideEffect", key, initialValue, reducer); + return source; + } + + public GraphTraversalSource WithStrategies(params ITraversalStrategy[] traversalStrategies) + { + var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies), + new Bytecode(Bytecode)); + var args = new List<object> {}; + args.AddRange(traversalStrategies); + source.Bytecode.AddSource("withStrategies", args.ToArray()); + return source; + } + + public GraphTraversalSource WithoutStrategies(params Type[] traversalStrategyClasses) + { + var source = new GraphTraversalSource(new List<ITraversalStrategy>(TraversalStrategies), + new Bytecode(Bytecode)); + var args = new List<object> {}; + args.AddRange(traversalStrategyClasses); + source.Bytecode.AddSource("withoutStrategies", args.ToArray()); return source; } @@ -159,10 +187,12 @@ namespace Gremlin.Net.Process.Traversal /// Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the E step to that /// traversal. /// </summary> - public GraphTraversal< Edge,Edge > E(params object[] args) + public GraphTraversal< Edge,Edge > E(params object[] edgesIds) { var traversal = new GraphTraversal< Edge,Edge >(TraversalStrategies, new Bytecode(Bytecode)); - traversal.Bytecode.AddStep("E", args); + var args = new List<object> {}; + args.AddRange(edgesIds); + traversal.Bytecode.AddStep("E", args.ToArray()); return traversal; } @@ -170,10 +200,36 @@ namespace Gremlin.Net.Process.Traversal /// Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the V step to that /// traversal. /// </summary> - public GraphTraversal< Vertex,Vertex > V(params object[] args) + public GraphTraversal< Vertex,Vertex > V(params object[] vertexIds) + { + var traversal = new GraphTraversal< Vertex,Vertex >(TraversalStrategies, new Bytecode(Bytecode)); + var args = new List<object> {}; + args.AddRange(vertexIds); + traversal.Bytecode.AddStep("V", args.ToArray()); + return traversal; + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the addV step to that + /// traversal. + /// </summary> + public GraphTraversal< Vertex,Vertex > AddV() + { + var traversal = new GraphTraversal< Vertex,Vertex >(TraversalStrategies, new Bytecode(Bytecode)); + traversal.Bytecode.AddStep("addV"); + return traversal; + } + + /// <summary> + /// Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the addV step to that + /// traversal. + /// </summary> + public GraphTraversal< Vertex,Vertex > AddV(params object[] keyValues) { var traversal = new GraphTraversal< Vertex,Vertex >(TraversalStrategies, new Bytecode(Bytecode)); - traversal.Bytecode.AddStep("V", args); + var args = new List<object> {}; + args.AddRange(keyValues); + traversal.Bytecode.AddStep("addV", args.ToArray()); return traversal; } @@ -181,10 +237,10 @@ namespace Gremlin.Net.Process.Traversal /// Spawns a <see cref="GraphTraversal{SType, EType}" /> off this graph traversal source and adds the addV step to that /// traversal. /// </summary> - public GraphTraversal< Vertex,Vertex > AddV(params object[] args) + public GraphTraversal< Vertex,Vertex > AddV(string label) { var traversal = new GraphTraversal< Vertex,Vertex >(TraversalStrategies, new Bytecode(Bytecode)); - traversal.Bytecode.AddStep("addV", args); + traversal.Bytecode.AddStep("addV", label); return traversal; }