Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ADAE8200C48 for ; Thu, 23 Feb 2017 15:16:09 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id AC6DF160B84; Thu, 23 Feb 2017 14:16:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E11D6160B86 for ; Thu, 23 Feb 2017 15:16:07 +0100 (CET) Received: (qmail 28022 invoked by uid 500); 23 Feb 2017 14:16:07 -0000 Mailing-List: contact commits-help@tinkerpop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tinkerpop.apache.org Delivered-To: mailing list commits@tinkerpop.apache.org Received: (qmail 27699 invoked by uid 99); 23 Feb 2017 14:16:06 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Feb 2017 14:16:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9B24BDFF8B; Thu, 23 Feb 2017 14:16:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: spmallette@apache.org To: commits@tinkerpop.apache.org Date: Thu, 23 Feb 2017 14:16:16 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [11/50] [abbrv] tinkerpop git commit: Added javadoc for all side-effect steps CTR archived-at: Thu, 23 Feb 2017 14:16:09 -0000 Added javadoc for all side-effect steps CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/dd85c733 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/dd85c733 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/dd85c733 Branch: refs/heads/TINKERPOP-1612 Commit: dd85c73301e06dfad329534c4d8b38a5ee7f7d2b Parents: c78d31b Author: Stephen Mallette Authored: Fri Feb 17 14:55:22 2017 -0500 Committer: Stephen Mallette Committed: Fri Feb 17 14:55:22 2017 -0500 ---------------------------------------------------------------------- .../traversal/dsl/graph/GraphTraversal.java | 76 ++++++++++++++++++++ 1 file changed, 76 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dd85c733/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java index 288e695..e324919 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java @@ -1761,21 +1761,53 @@ public interface GraphTraversal extends Traversal { return this.asAdmin().addStep(new TraversalSideEffectStep<>(this.asAdmin(), (Traversal) sideEffectTraversal)); } + /** + * Iterates the traversal up to the itself and emits the side-effect referenced by the key. If multiple keys are + * supplied then the side-effects are emitted as a {@code Map}. + * + * @param sideEffectKey the side-effect to emit + * @param sideEffectKeys other side-effects to emit + * @return the traversal with an appended {@link SideEffectCapStep} + * @see Reference Documentation - Cap Step + */ public default GraphTraversal cap(final String sideEffectKey, final String... sideEffectKeys) { this.asAdmin().getBytecode().addStep(Symbols.cap, sideEffectKey, sideEffectKeys); return this.asAdmin().addStep(new SideEffectCapStep<>(this.asAdmin(), sideEffectKey, sideEffectKeys)); } + /** + * Extracts a portion of the graph being traversed into a {@link Graph} object held in the specified side-effect + * key. + * + * @param sideEffectKey the name of the side-effect key that will hold the subgraph + * @return the traversal with an appended {@link SubgraphStep} + * @see Reference Documentation - Subgraph Step + */ public default GraphTraversal subgraph(final String sideEffectKey) { this.asAdmin().getBytecode().addStep(Symbols.subgraph, sideEffectKey); return this.asAdmin().addStep(new SubgraphStep(this.asAdmin(), sideEffectKey)); } + /** + * Eagerly collects objects up to this step into a side-effect. + * + * @param sideEffectKey the name of the side-effect key that will hold the aggregated objects + * @return the traversal with an appended {@link AggregateStep} + * @see Reference Documentation - Aggregate Step + */ public default GraphTraversal aggregate(final String sideEffectKey) { this.asAdmin().getBytecode().addStep(Symbols.aggregate, sideEffectKey); return this.asAdmin().addStep(new AggregateStep<>(this.asAdmin(), sideEffectKey)); } + /** + * Organize objects in the stream into a {@code Map}. Calls to {@code group()} are typically accompanied with + * {@link #by()} modulators which help specify how the grouping should occur. + * + * @param sideEffectKey the name of the side-effect key that will hold the aggregated grouping + * @return the traversal with an appended {@link GroupStep}. + * @see Reference Documentation - Group Step + */ public default GraphTraversal group(final String sideEffectKey) { this.asAdmin().getBytecode().addStep(Symbols.group, sideEffectKey); return this.asAdmin().addStep(new GroupSideEffectStep<>(this.asAdmin(), sideEffectKey)); @@ -1789,16 +1821,38 @@ public interface GraphTraversal extends Traversal { return this.asAdmin().addStep(new GroupSideEffectStepV3d0<>(this.asAdmin(), sideEffectKey)); } + /** + * Counts the number of times a particular objects has been part of a traversal, returning a {@code Map} where the + * object is the key and the value is the count. + * + * @param sideEffectKey the name of the side-effect key that will hold the aggregated grouping + * @return the traversal with an appended {@link GroupCountStep}. + * @see Reference Documentation - GroupCount Step + */ public default GraphTraversal groupCount(final String sideEffectKey) { this.asAdmin().getBytecode().addStep(Symbols.groupCount, sideEffectKey); return this.asAdmin().addStep(new GroupCountSideEffectStep<>(this.asAdmin(), sideEffectKey)); } + /** + * Aggregates the emanating paths into a {@link Tree} data structure. + * + * @param sideEffectKey the name of the side-effect key that will hold the tree + * @return the traversal with an appended {@link TreeStep} + * @see Reference Documentation - Tree Step + */ public default GraphTraversal tree(final String sideEffectKey) { this.asAdmin().getBytecode().addStep(Symbols.tree, sideEffectKey); return this.asAdmin().addStep(new TreeSideEffectStep<>(this.asAdmin(), sideEffectKey)); } + /** + * Map the {@link Traverser} to its {@link Traverser#sack} value. + * + * @param sackOperator the operator to apply to the sack value + * @return the traversal with an appended {@link SackStep}. + * @see Reference Documentation - Sack Step + */ public default GraphTraversal sack(final BiFunction sackOperator) { this.asAdmin().getBytecode().addStep(Symbols.sack, sackOperator); return this.asAdmin().addStep(new SackValueStep<>(this.asAdmin(), sackOperator)); @@ -1812,16 +1866,38 @@ public interface GraphTraversal extends Traversal { return this.sack(sackOperator).by(elementPropertyKey); } + /** + * Lazily aggregates objects in the stream into a side-effect collection. + * + * @param sideEffectKey the name of the side-effect key that will hold the aggregate + * @return the traversal with an appended {@link StoreStep} + * @see Reference Documentation - Store Step + */ public default GraphTraversal store(final String sideEffectKey) { this.asAdmin().getBytecode().addStep(Symbols.store, sideEffectKey); return this.asAdmin().addStep(new StoreStep<>(this.asAdmin(), sideEffectKey)); } + /** + * Allows developers to examine statistical information about a traversal providing data like execution times, + * counts, etc. + * + * @param sideEffectKey the name of the side-effect key within which to hold the profile object + * @return the traversal with an appended {@link ProfileSideEffectStep} + * @see Reference Documentation - Profile Step + */ public default GraphTraversal profile(final String sideEffectKey) { this.asAdmin().getBytecode().addStep(Traversal.Symbols.profile, sideEffectKey); return this.asAdmin().addStep(new ProfileSideEffectStep<>(this.asAdmin(), sideEffectKey)); } + /** + * Allows developers to examine statistical information about a traversal providing data like execution times, + * counts, etc. + * + * @return the traversal with an appended {@link ProfileSideEffectStep} + * @see Reference Documentation - Profile Step + */ @Override public default GraphTraversal profile() { return (GraphTraversal) Traversal.super.profile();