Class AddLabelStep<S extends Element>
java.lang.Object
org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep<S,S>
org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectStep<S>
org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AddLabelStep<S>
- All Implemented Interfaces:
Serializable,AutoCloseable,Cloneable,Iterator<Traverser.Admin<S>>,Step<S,,S> Mutating<Event.ElementLabelChangedEvent>,PopContaining,TraversalParent
public class AddLabelStep<S extends Element>
extends SideEffectStep<S>
implements Mutating<Event.ElementLabelChangedEvent>, TraversalParent
Side-effect step that adds labels to the current element by calling
Element.addLabel(String, String...).
Providers that support label mutation must override addLabel() in their Element implementations.- Since:
- 4.0.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.PopContaining
PopContaining.PopInstruction -
Field Summary
Fields inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep
id, nextEnd, nextStep, previousStep, starts, traversal, traverserStepIdAndLabelsSetByChild -
Constructor Summary
ConstructorsConstructorDescriptionAddLabelStep(Traversal.Admin traversal, String label, String... moreLabels) AddLabelStep(Traversal.Admin traversal, List<Traversal.Admin<S, ?>> labelTraversals) Constructor for one or more label traversals. -
Method Summary
Modifier and TypeMethodDescriptionclone()Cloning is used to duplicate steps for the purpose of traversal optimization and OLTP replication.List<Traversal.Admin<S,?>> Gets a list of all "local" child traversals for this step.Gets the callback registry for events that the step raises.Provide the necessaryTraverserRequirementthat must be met by the traverser in order for the step to function properly.inthashCode()voidsetTraversal(Traversal.Admin<?, ?> parentTraversal) Set theTraversalthat this step is contained within.protected voidsideEffect(Traverser.Admin<S> traverser) toString()Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectStep
processNextStartMethods inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep
addLabel, addStart, addStarts, clearLabels, equals, getId, getLabels, getNextStep, getPreviousStep, getStarts, getTraversal, hasNext, hasStarts, isTraverserStepIdAndLabelsSetByChild, next, prepareTraversalForNextStep, removeLabel, reset, setId, setNextStep, setPreviousStepMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, removeMethods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent
addGlobalChild, addLocalChild, asStep, close, getGlobalChildren, getPopInstructions, getSelfAndChildRequirements, integrateChild, removeGlobalChild, removeLocalChild, replaceLocalChild
-
Constructor Details
-
AddLabelStep
-
AddLabelStep
Constructor for one or more label traversals. If exactly one traversal is given and it produces aCollection, the collection is unfolded into the set of labels added; otherwise each traversal must resolve to a singleStringlabel.
-
-
Method Details
-
sideEffect
- Specified by:
sideEffectin classSideEffectStep<S extends Element>
-
getMutatingCallbackRegistry
Description copied from interface:MutatingGets the callback registry for events that the step raises.- Specified by:
getMutatingCallbackRegistryin interfaceMutating<S extends Element>
-
getRequirements
Description copied from interface:StepProvide the necessaryTraverserRequirementthat must be met by the traverser in order for the step to function properly. The provided default implements returns an empty set. -
toString
-
hashCode
public int hashCode() -
getLocalChildren
Description copied from interface:TraversalParentGets a list of all "local" child traversals for this step. A "local" traversal is one which is evaluated independently for each incoming traverser to the parent step. This is typically used in cases where the child is used to process or augment each traverser individually. SeeLocalSteporByModulatingas examples.- Specified by:
getLocalChildrenin interfaceTraversalParent
-
clone
Description copied from interface:StepCloning is used to duplicate steps for the purpose of traversal optimization and OLTP replication. When cloning a step, it is important that the steps, the cloned step is equivalent to the state of the step whenStep.reset()is called. Moreover, the previous and next steps should be set toEmptyStep. -
setTraversal
Description copied from interface:StepSet theTraversalthat this step is contained within.- Specified by:
setTraversalin interfaceStep<S extends Element,S extends Element> - Overrides:
setTraversalin classAbstractStep<S extends Element,S extends Element> - Parameters:
parentTraversal- the new traversal for this step
-