Traversal$Admin.addStep
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.apache.tinkerpop.gremlin.process.traversal.Traversal$Admin.addStep(Showing top 15 results out of 315)

  • Common ways to obtain Traversal$Admin
private void myMethod () {
Traversal$Admin t =
  • GraphStep graphStep;graphStep.getTraversal()
  • Smart code suggestions by Codota
}
origin: apache/tinkerpop

public ChooseStep(final Traversal.Admin traversal, final Traversal.Admin<S, ?> predicateTraversal, final Traversal.Admin<S, E> trueChoice, final Traversal.Admin<S, E> falseChoice) {
  this(traversal, (Traversal.Admin<S, M>) predicateTraversal.addStep(new HasNextStep<>(predicateTraversal)));
  this.addGlobalChildOption((M) Boolean.TRUE, trueChoice);
  this.addGlobalChildOption((M) Boolean.FALSE, falseChoice);
}
origin: apache/tinkerpop

public static <A, B, C extends Traversal<A, B>> C addRepeatToTraversal(final C traversal, final Traversal.Admin<B, B> repeatTraversal) {
  final Step<?, B> step = traversal.asAdmin().getEndStep();
  if (step instanceof RepeatStep && null == ((RepeatStep) step).repeatTraversal) {
    ((RepeatStep<B>) step).setRepeatTraversal(repeatTraversal);
  } else {
    final RepeatStep<B> repeatStep = new RepeatStep<>(traversal.asAdmin());
    repeatStep.setRepeatTraversal(repeatTraversal);
    traversal.asAdmin().addStep(repeatStep);
  }
  return traversal;
}
origin: apache/tinkerpop

/**
 * Add a {@link Step} to the end of the traversal. This method should link the step to its next and previous step accordingly.
 *
 * @param step the step to add
 * @param <E2> the output of the step
 * @return the updated traversal
 * @throws IllegalStateException if the {@link TraversalStrategies} have already been applied
 */
public default <E2> Traversal.Admin<S, E2> addStep(final Step<?, E2> step) throws IllegalStateException {
  return this.addStep(this.getSteps().size(), step);
}
origin: org.apache.tinkerpop/gremlin-core

@Override
public void addGlobalChildOption(final M pickToken, final Traversal.Admin<S, E> traversalOption) {
  if (this.traversalOptions.containsKey(pickToken))
    this.traversalOptions.get(pickToken).add(traversalOption);
  else
    this.traversalOptions.put(pickToken, new ArrayList<>(Collections.singletonList(traversalOption)));
  traversalOption.addStep(new EndStep(traversalOption));
  if (!this.hasBarrier && !TraversalHelper.getStepsOfAssignableClassRecursively(Barrier.class, traversalOption).isEmpty())
    this.hasBarrier = true;
  this.integrateChild(traversalOption);
}
origin: org.apache.tinkerpop/gremlin-core

/**
 * Insert a step after a specified step instance.
 *
 * @param insertStep the step to insert
 * @param beforeStep the step to insert the new step after
 * @param traversal  the traversal on which the action should occur
 */
public static <S, E> void insertAfterStep(final Step<S, E> insertStep, final Step<?, S> beforeStep, final Traversal.Admin<?, ?> traversal) {
  traversal.addStep(stepIndex(beforeStep, traversal) + 1, insertStep);
}
origin: org.apache.tinkerpop/gremlin-core

public static <S, E> void removeToTraversal(final Step<S, ?> startStep, final Step<?, E> endStep, final Traversal.Admin<S, E> newTraversal) {
  final Traversal.Admin<?, ?> originalTraversal = startStep.getTraversal();
  Step<?, ?> currentStep = startStep;
  while (currentStep != endStep && !(currentStep instanceof EmptyStep)) {
    final Step<?, ?> temp = currentStep.getNextStep();
    originalTraversal.removeStep(currentStep);
    newTraversal.addStep(currentStep);
    currentStep = temp;
  }
}
origin: apache/tinkerpop

@Test
@LoadGraphWith(MODERN)
public void testProfileStrategyCallback() {
  final Traversal<Vertex, TraversalMetrics> t = get_g_V_out_out_profile();
  MockStep mockStep = new MockStep(t.asAdmin());
  t.asAdmin().addStep(3, mockStep);
  TraversalMetrics traversalMetrics = t.next();
  assertTrue(mockStep.callbackCalled);
  if (!onGraphComputer(t.asAdmin())) {
    assertEquals(100, traversalMetrics.getMetrics(3).getCount("bogusCount").longValue());
  }
}
origin: org.apache.tinkerpop/gremlin-core

@SuppressWarnings("unchecked")
public void setRepeatTraversal(final Traversal.Admin<S, S> repeatTraversal) {
  if (null != this.repeatTraversal)
    throw new IllegalStateException("The repeat()-step already has its loop section declared: " + this);
  this.repeatTraversal = repeatTraversal; // .clone();
  this.repeatTraversal.addStep(new RepeatEndStep(this.repeatTraversal));
  this.integrateChild(this.repeatTraversal);
}
origin: org.apache.tinkerpop/gremlin-core

/**
 * Replace a step with a new step.
 *
 * @param removeStep the step to remove
 * @param insertStep the step to insert
 * @param traversal  the traversal on which the action will occur
 */
public static <S, E> void replaceStep(final Step<S, E> removeStep, final Step<S, E> insertStep, final Traversal.Admin<?, ?> traversal) {
  final int i;
  traversal.removeStep(i = stepIndex(removeStep, traversal));
  traversal.addStep(i, insertStep);
}
origin: unipop-graph/unipop

public UniGraphUnionStep(Traversal.Admin traversal, UniGraph graph, final Traversal.Admin<?, E>... unionTraversals) {
  super(traversal, graph);
  this.unionTraversals = Arrays.asList(unionTraversals);
  this.unionTraversals.forEach(t -> t.addStep(new UniGraphTraverserStep<>(t)));
}
origin: org.apache.tinkerpop/gremlin-core

/**
 * Filter all traversers in the traversal.
 *
 * @return the updated traversal with respective {@link NoneStep}.
 */
public default Traversal<S, E> none() {
  this.asAdmin().getBytecode().addStep(Symbols.none);
  return this.asAdmin().addStep(new NoneStep<>(this.asAdmin()));
}
origin: apache/tinkerpop

public static <A, B, C extends Traversal<A, B>> C addEmitToTraversal(final C traversal, final Traversal.Admin<B, ?> emitPredicate) {
  final Step<?, B> step = traversal.asAdmin().getEndStep();
  if (step instanceof RepeatStep && null == ((RepeatStep) step).emitTraversal) {
    ((RepeatStep<B>) step).setEmitTraversal(emitPredicate);
  } else {
    final RepeatStep<B> repeatStep = new RepeatStep<>(traversal.asAdmin());
    repeatStep.setEmitTraversal(emitPredicate);
    traversal.asAdmin().addStep(repeatStep);
  }
  return traversal;
}
origin: org.apache.tinkerpop/gremlin-core

public static <A, B, C extends Traversal<A, B>> C addRepeatToTraversal(final C traversal, final Traversal.Admin<B, B> repeatTraversal) {
  final Step<?, B> step = traversal.asAdmin().getEndStep();
  if (step instanceof RepeatStep && null == ((RepeatStep) step).repeatTraversal) {
    ((RepeatStep<B>) step).setRepeatTraversal(repeatTraversal);
  } else {
    final RepeatStep<B> repeatStep = new RepeatStep<>(traversal.asAdmin());
    repeatStep.setRepeatTraversal(repeatTraversal);
    traversal.asAdmin().addStep(repeatStep);
  }
  return traversal;
}
origin: apache/tinkerpop

/**
 * Replace a step with a new step.
 *
 * @param removeStep the step to remove
 * @param insertStep the step to insert
 * @param traversal  the traversal on which the action will occur
 */
public static <S, E> void replaceStep(final Step<S, E> removeStep, final Step<S, E> insertStep, final Traversal.Admin<?, ?> traversal) {
  final int i;
  traversal.removeStep(i = stepIndex(removeStep, traversal));
  traversal.addStep(i, insertStep);
}
origin: apache/tinkerpop

public static <S, E> void removeToTraversal(final Step<S, ?> startStep, final Step<?, E> endStep, final Traversal.Admin<S, E> newTraversal) {
  final Traversal.Admin<?, ?> originalTraversal = startStep.getTraversal();
  Step<?, ?> currentStep = startStep;
  while (currentStep != endStep && !(currentStep instanceof EmptyStep)) {
    final Step<?, ?> temp = currentStep.getNextStep();
    originalTraversal.removeStep(currentStep);
    newTraversal.addStep(currentStep);
    currentStep = temp;
  }
}
org.apache.tinkerpop.gremlin.process.traversalTraversal$AdminaddStep

Javadoc

Add a Step to the end of the traversal. This method should link the step to its next and previous step accordingly.

Popular methods of Traversal$Admin

  • asAdmin
  • getStartStep
    Get the start/head of the traversal. If the traversal is empty, then an EmptyStep instance is return
  • removeStep
    Remove a Step from the traversal.
  • getGraph
  • getSteps
    Get the Step instances associated with this traversal. The steps are ordered according to their link
  • addStart
    Add a single Traverser.Admin object to the head of the traversal. Users should typically not need to
  • getStrategies
    Get the TraversalStrategies associated with this traversal.
  • getTraverserGenerator
    Get the TraverserGenerator associated with this traversal. The traversal generator creates Traverser
  • getParent
    Get the org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent Step that is the parent
  • getSideEffects
    Get the TraversalSideEffects associated with the traversal.
  • getTraverserRequirements
    Get the set of all TraverserRequirements for this traversal.
  • hasNext
  • getTraverserRequirements,
  • hasNext,
  • getBytecode,
  • getEndStep,
  • applyStrategies,
  • clone,
  • isLocked,
  • next,
  • nextTraverser

Popular classes and methods

  • findViewById (Activity)
  • runOnUiThread (Activity)
  • Component (java.awt)
  • RandomAccessFile (java.io)
    Saves binary data to the local storage; currently using hex encoding. The string is prefixed with "h
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on *
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)