Class AddVertexStep<S>
java.lang.Object
org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep<S,E>
org.apache.tinkerpop.gremlin.process.traversal.step.map.MapStep<S,E>
org.apache.tinkerpop.gremlin.process.traversal.step.map.ScalarMapStep<S,Vertex>
org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStep<S>
- All Implemented Interfaces:
Serializable,AutoCloseable,Cloneable,Iterator<Traverser.Admin<Vertex>>,Step<S,,Vertex> Configuring,AddElementStepContract<S,,Vertex> AddVertexStepContract<S>,Mutating<Event.VertexAddedEvent>,Parameterizing,PopContaining,PropertiesHolder,Scoping,TraversalParent,Writing<Event.VertexAddedEvent>
- Author:
- Marko A. Rodriguez (http://markorodriguez.com), Stephen Mallette (http://stephen.genoprime.com)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.PopContaining
PopContaining.PopInstructionNested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.Scoping
Scoping.KeyNotFoundException, Scoping.Variable -
Field Summary
Fields inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep
id, labels, nextEnd, nextStep, previousStep, starts, traversal, traverserStepIdAndLabelsSetByChildFields inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStepContract
CONCRETE_STEPS -
Constructor Summary
ConstructorsConstructorDescriptionAddVertexStep(Traversal.Admin traversal, String label) AddVertexStep(Traversal.Admin traversal, List<Traversal.Admin<?, ?>> labelTraversals) Constructor for multiple label traversals.AddVertexStep(Traversal.Admin traversal, Set<String> labels) AddVertexStep(Traversal.Admin traversal, Traversal.Admin<S, ?> vertexLabelTraversal) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProperty(Object key, Object value) clone()Cloning is used to duplicate steps for the purpose of traversal optimization and OLTP replication.voidAccept a configuration to theStep.getLabel()Gets the label(s) assigned to the element produced by this step.<S,E> List<Traversal.Admin<S, E>> Gets a list of all "local" child traversals for this step.Gets the callback registry for events that the step raises.Gets the parameters on the step.Provide the necessaryTraverserRequirementthat must be met by the traverser in order for the step to function properly.Get the labels that this scoping step will access during the traversalinthashCode()booleanprotected Vertexmap(Traverser.Admin<S> traverser) booleanbooleanvoidsetElementId(Object elementId) voidSets the label(s) to assign to the element produced by this step.voidsetTraversal(Traversal.Admin<?, ?> parentTraversal) Set theTraversalthat this step is contained within.toString()Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.step.map.ScalarMapStep
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 org.apache.tinkerpop.gremlin.process.traversal.step.map.AddElementStepContract
getElementIdWithGValue, getLabelWithGValue, getPopInstructionsMethods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, removeMethods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.PropertiesHolder
getPropertiesWithGValuesMethods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.Scoping
getNullableScopeValue, getSafeScopeValue, getScopeValueMethods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.Step
addLabel, addStart, addStarts, clearLabels, equals, getId, getLabels, getNextStep, getPreviousStep, getTraversal, hasStarts, removeLabel, reset, setId, setNextStep, setPreviousStepMethods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent
addGlobalChild, addLocalChild, asStep, close, getGlobalChildren, getSelfAndChildRequirements, integrateChild, removeGlobalChild, removeLocalChild, replaceLocalChild
-
Constructor Details
-
AddVertexStep
-
AddVertexStep
-
AddVertexStep
-
AddVertexStep
Constructor for multiple label traversals. Each traversal is resolved to a single String label at execution time.
-
-
Method Details
-
hasUserProvidedLabel
public boolean hasUserProvidedLabel()- Specified by:
hasUserProvidedLabelin interfaceAddVertexStepContract<S>
-
getElementId
- Specified by:
getElementIdin interfaceAddElementStepContract<S,Vertex>
-
setElementId
- Specified by:
setElementIdin interfaceAddElementStepContract<S,Vertex>
-
getParameters
Description copied from interface:ParameterizingGets the parameters on the step.- Specified by:
getParametersin interfaceParameterizing
-
getScopeKeys
Description copied from interface:ScopingGet the labels that this scoping step will access during the traversal- Specified by:
getScopeKeysin interfaceScoping- Returns:
- the accessed labels of the scoping step
-
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
-
configure
Description copied from interface:ConfiguringAccept a configuration to theStep. Note that this interface extendsParameterizingand so there is an expectation that theStepimplementation will have aParametersinstance that will house any values passed to this method. Storing these configurations inParametersis not a requirement however, IF the configuration is an expected option for the step and can be stored on a member field that can be accessed on the step by more direct means (i.e. like a getter method).- Specified by:
configurein interfaceConfiguring
-
map
- Specified by:
mapin classScalarMapStep<S,Vertex>
-
getMutatingCallbackRegistry
Description copied from interface:MutatingGets the callback registry for events that the step raises.- Specified by:
getMutatingCallbackRegistryin interfaceMutating<S>
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractStep<S,Vertex>
-
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.- Specified by:
getRequirementsin interfaceStep<S,Vertex> - Returns:
- the set of requirements
-
toString
- Overrides:
toStringin classAbstractStep<S,Vertex>
-
setTraversal
Description copied from interface:StepSet theTraversalthat this step is contained within.- Specified by:
setTraversalin interfaceStep<S,Vertex> - Overrides:
setTraversalin classAbstractStep<S,Vertex> - Parameters:
parentTraversal- the new traversal for this step
-
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. -
getLabel
Description copied from interface:AddElementStepContractGets the label(s) assigned to the element produced by this step. Returns a single value, or aSetwhen multiple labels were specified (e.g.addV("a", "b")). Each individual label value will either be aStringorTraversaldepending on how it was initially set. Callers should not assume the type isStringand should check withinstanceofbefore casting.- Specified by:
getLabelin interfaceAddElementStepContract<S,Vertex> - Returns:
- a
String,Traversal, or aSetcontaining either
-
setLabel
Description copied from interface:AddElementStepContractSets the label(s) to assign to the element produced by this step. Accepts a singleString,GValue<String>, orTraversalresolving to aString, or aCollection<Object>of two or more such values. Should behave identically to specifying the same value at construction time. Implementations may restrict calling this method more than once at their own discretion.- Specified by:
setLabelin interfaceAddElementStepContract<S,Vertex> - Parameters:
label- aString,GValue<String>,Traversal, orCollection<Object>
-
getProperties
- Specified by:
getPropertiesin interfacePropertiesHolder
-
removeProperty
- Specified by:
removePropertyin interfacePropertiesHolder
-
removeElementId
public boolean removeElementId()- Specified by:
removeElementIdin interfaceAddElementStepContract<S,Vertex>
-
addProperty
- Specified by:
addPropertyin interfacePropertiesHolder
-