Java Code Examples for org.apache.tinkerpop.gremlin.process.traversal.step.branch.RepeatStep#addEmitToTraversal()

The following examples show how to use org.apache.tinkerpop.gremlin.process.traversal.step.branch.RepeatStep#addEmitToTraversal() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GraphTraversal.java    From tinkerpop with Apache License 2.0 2 votes vote down vote up
/**
 * Emit is used in conjunction with {@link #repeat(Traversal)} to determine what objects get emit from the loop.
 *
 * @param emitTraversal the emit predicate defined as a traversal
 * @return the traversal with the appended {@link RepeatStep}
 * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#repeat-step" target="_blank">Reference Documentation - Repeat Step</a>
 * @since 3.0.0-incubating
 */
public default GraphTraversal<S, E> emit(final Traversal<?, ?> emitTraversal) {
    this.asAdmin().getBytecode().addStep(Symbols.emit, emitTraversal);
    return RepeatStep.addEmitToTraversal(this, (Traversal.Admin<E, ?>) emitTraversal);
}
 
Example 2
Source File: GraphTraversal.java    From tinkerpop with Apache License 2.0 2 votes vote down vote up
/**
 * Emit is used in conjunction with {@link #repeat(Traversal)} to determine what objects get emit from the loop.
 *
 * @param emitPredicate the emit predicate
 * @return the traversal with the appended {@link RepeatStep}
 * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#repeat-step" target="_blank">Reference Documentation - Repeat Step</a>
 * @since 3.0.0-incubating
 */
public default GraphTraversal<S, E> emit(final Predicate<Traverser<E>> emitPredicate) {
    this.asAdmin().getBytecode().addStep(Symbols.emit, emitPredicate);
    return RepeatStep.addEmitToTraversal(this, (Traversal.Admin<E, ?>) __.filter(emitPredicate));
}
 
Example 3
Source File: GraphTraversal.java    From tinkerpop with Apache License 2.0 2 votes vote down vote up
/**
 * Emit is used in conjunction with {@link #repeat(Traversal)} to emit all objects from the loop.
 *
 * @return the traversal with the appended {@link RepeatStep}
 * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#repeat-step" target="_blank">Reference Documentation - Repeat Step</a>
 * @since 3.0.0-incubating
 */
public default GraphTraversal<S, E> emit() {
    this.asAdmin().getBytecode().addStep(Symbols.emit);
    return RepeatStep.addEmitToTraversal(this, TrueTraversal.instance());
}