Class EmptyTraverser<T>
- java.lang.Object
- 
- org.apache.tinkerpop.gremlin.process.traversal.traverser.util.EmptyTraverser<T>
 
- 
- All Implemented Interfaces:
- Serializable,- Cloneable,- Comparable<Traverser<T>>,- Traverser<T>,- Traverser.Admin<T>,- Attachable<T>
 - Direct Known Subclasses:
- DummyTraverser
 
 public class EmptyTraverser<T> extends Object implements Traverser<T>, Traverser.Admin<T> ATraverserwith no bulk which effectively means that it will no longer be propagated through aTraversal.- Author:
- Marko A. Rodriguez (http://markorodriguez.com)
- See Also:
- Serialized Form
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.util.AttachableAttachable.Exceptions, Attachable.Method
 - 
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraverserTraverser.Admin<T>
 
- 
 - 
Field Summary- 
Fields inherited from interface org.apache.tinkerpop.gremlin.structure.util.Attachablelogger
 - 
Fields inherited from interface org.apache.tinkerpop.gremlin.process.traversal.Traverser.AdminHALT
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedEmptyTraverser()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLabels(Set<String> labels)Tattach(Function<Attachable<T>,T> method)Regenerate the detached traverser given its location at a particular vertex.longbulk()A traverser may represent a grouping of traversers to allow for more efficient data propagation.EmptyTraverser<T>clone()Traverser cloning is important when splitting a traverser at a bifurcation point in a traversal.Traverser.Admin<T>detach()Prepare the traverser for migration across a JVM boundary.voiddropLabels(Set<String> labels)Drop all path information associated with specified labels.voiddropPath()Drop the path of the traverser.booleanequals(Object object)Tget()Get the object that the traverser is current at.TraversalSideEffectsgetSideEffects()Get the sideEffects associated with the traversal of the traverser.StringgetStepId()Get the step id of where the traverser is located.Set<String>getTags()Get the tags associated with the traverser.inthashCode()voidincrLoops()Increment the number of times the traverser has gone through a looping section of traversal.voidinitialiseLoops(String stepLabel, String loopNam)Initialise a loop by setting up the looping construct.static <R> EmptyTraverser<R>instance()The emptyTraverserinstance.voidkeepLabels(Set<String> labels)Drop all path information not associated with specified labels.intloops()Return the number of times the traverser has gone through a looping section of a traversal.intloops(String loopName)Return the number of times the traverser has gone through the named looping section of a traversal.voidmerge(Traverser.Admin<?> other)When two traversers are have equality with each other, then they can be merged.Pathpath()Get the current path of the traverser.voidresetLoops()Set the number of times the traverser has gone through a loop back to 0.<S> Ssack()Get the sack local sack object of this traverser.<S> voidsack(S object)Set the traversers sack object to the provided value ("sack the value").voidset(T t)Set the current object location of the traverser.voidsetBulk(long count)Set the number of traversers represented by this traverser.voidsetSideEffects(TraversalSideEffects sideEffects)Set the sideEffects of theTraversal.voidsetStepId(String stepId)Set the step id of where the traverser is located.Traverser.Admin<T>split()Generate a sibling traverser of the current traverser with a full copy of all state within the sibling.<R> Traverser.Admin<R>split(R r, Step<T,R> step)Generate a child traverser of the current traverser for current as step and new object location.- 
Methods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraverserasAdmin, compareTo, path, path, sideEffects, sideEffects
 - 
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.Traverser.AdmingetLoopNames, isHalted
 
- 
 
- 
- 
- 
Method Detail- 
instancepublic static <R> EmptyTraverser<R> instance() The emptyTraverserinstance.
 - 
addLabelspublic void addLabels(Set<String> labels) - Specified by:
- addLabelsin interface- Traverser.Admin<T>
 
 - 
keepLabelspublic void keepLabels(Set<String> labels) Description copied from interface:Traverser.AdminDrop all path information not associated with specified labels. This is an optimization method that allows a traverser to save memory and increase the likelihood of bulking.- Specified by:
- keepLabelsin interface- Traverser.Admin<T>
- Parameters:
- labels- the labels to keep path information for.
 
 - 
dropLabelspublic void dropLabels(Set<String> labels) Description copied from interface:Traverser.AdminDrop all path information associated with specified labels. This is an optimization method that allows a traverser to save memory and increase the likelihood of bulking.- Specified by:
- dropLabelsin interface- Traverser.Admin<T>
- Parameters:
- labels- the labels to drop path information for.
 
 - 
dropPathpublic void dropPath() Description copied from interface:Traverser.AdminDrop the path of the traverser. This is an optimization method that allows a traverser to save memory and increase the likelihood of bulking.- Specified by:
- dropPathin interface- Traverser.Admin<T>
 
 - 
setpublic void set(T t) Description copied from interface:Traverser.AdminSet the current object location of the traverser.- Specified by:
- setin interface- Traverser.Admin<T>
- Parameters:
- t- The current object of the traverser
 
 - 
initialiseLoopspublic void initialiseLoops(String stepLabel, String loopNam) Description copied from interface:Traverser.AdminInitialise a loop by setting up the looping construct. The step label is important to create a stack of loop counters when within a nested context. If the provided label is not the same as the current label on the stack, add a new loop counter. The loopName can be used to refer to the loops counter via theLoopsStep- Specified by:
- initialiseLoopsin interface- Traverser.Admin<T>
- Parameters:
- stepLabel- the label of the step that is being set-up.
- loopNam- the user defined name for referencing the loop counter or null if not set
 
 - 
incrLoopspublic void incrLoops() Description copied from interface:Traverser.AdminIncrement the number of times the traverser has gone through a looping section of traversal.- Specified by:
- incrLoopsin interface- Traverser.Admin<T>
 
 - 
resetLoopspublic void resetLoops() Description copied from interface:Traverser.AdminSet the number of times the traverser has gone through a loop back to 0. When a traverser exits a looping construct, this method should be called. In a nested loop context, the highest stack loop counter should be removed.- Specified by:
- resetLoopsin interface- Traverser.Admin<T>
 
 - 
getStepIdpublic String getStepId() Description copied from interface:Traverser.AdminGet the step id of where the traverser is located. This is typically used in multi-machine systems that require the movement of traversers between different traversal instances.- Specified by:
- getStepIdin interface- Traverser.Admin<T>
- Returns:
- The future step for the traverser
 
 - 
setStepIdpublic void setStepId(String stepId) Description copied from interface:Traverser.AdminSet the step id of where the traverser is located. If the future isTraverser.Admin.HALT, thenTraverser.Admin.isHalted()is true.- Specified by:
- setStepIdin interface- Traverser.Admin<T>
- Parameters:
- stepId- The future step of the traverser
 
 - 
setBulkpublic void setBulk(long count) Description copied from interface:Traverser.AdminSet the number of traversers represented by this traverser.- Specified by:
- setBulkin interface- Traverser.Admin<T>
- Parameters:
- count- the number of traversers
 
 - 
splitpublic <R> Traverser.Admin<R> split(R r, Step<T,R> step) Description copied from interface:Traverser.AdminGenerate a child traverser of the current traverser for current as step and new object location. The child has the path history, future, and loop information of the parent. The child extends that path history with the current as and provided R-object.- Specified by:
- splitin interface- Traverser.Admin<T>
- Type Parameters:
- R- The current object type of the child
- Parameters:
- r- The current object of the child
- step- The step yielding the split
- Returns:
- The split traverser
 
 - 
splitpublic Traverser.Admin<T> split() Description copied from interface:Traverser.AdminGenerate a sibling traverser of the current traverser with a full copy of all state within the sibling.- Specified by:
- splitin interface- Traverser.Admin<T>
- Returns:
- The split traverser
 
 - 
detachpublic Traverser.Admin<T> detach() Description copied from interface:Traverser.AdminPrepare the traverser for migration across a JVM boundary.- Specified by:
- detachin interface- Traverser.Admin<T>
- Returns:
- The deflated traverser
 
 - 
attachpublic T attach(Function<Attachable<T>,T> method) Description copied from interface:Traverser.AdminRegenerate the detached traverser given its location at a particular vertex.- Specified by:
- attachin interface- Attachable<T>
- Specified by:
- attachin interface- Traverser.Admin<T>
- Parameters:
- method- The method by which to attach a- Traverserto an vertex.
- Returns:
- The inflated traverser
 
 - 
setSideEffectspublic void setSideEffects(TraversalSideEffects sideEffects) Description copied from interface:Traverser.AdminSet the sideEffects of theTraversal. Given that traversers can move between machines, it may be important to re-set this when the traverser crosses machine boundaries.- Specified by:
- setSideEffectsin interface- Traverser.Admin<T>
- Parameters:
- sideEffects- the sideEffects of the traversal.
 
 - 
getpublic T get() Description copied from interface:TraverserGet the object that the traverser is current at.
 - 
sackpublic <S> S sack() Description copied from interface:TraverserGet the sack local sack object of this traverser.
 - 
sackpublic <S> void sack(S object) Description copied from interface:TraverserSet the traversers sack object to the provided value ("sack the value").
 - 
mergepublic void merge(Traverser.Admin<?> other) Description copied from interface:Traverser.AdminWhen two traversers are have equality with each other, then they can be merged. This method is used to merge the traversers into a single traverser. This is used for optimization where instead of enumerating all traversers, they can be counted.- Specified by:
- mergein interface- Traverser.Admin<T>
- Parameters:
- other- the other traverser to merge into this traverser. Once merged, the other can be garbage collected.
 
 - 
pathpublic Path path() Description copied from interface:TraverserGet the current path of the traverser.
 - 
loopspublic int loops() Description copied from interface:TraverserReturn the number of times the traverser has gone through a looping section of a traversal.
 - 
loopspublic int loops(String loopName) Description copied from interface:TraverserReturn the number of times the traverser has gone through the named looping section of a traversal.
 - 
bulkpublic long bulk() Description copied from interface:TraverserA traverser may represent a grouping of traversers to allow for more efficient data propagation.
 - 
getSideEffectspublic TraversalSideEffects getSideEffects() Description copied from interface:Traverser.AdminGet the sideEffects associated with the traversal of the traverser.- Specified by:
- getSideEffectsin interface- Traverser.Admin<T>
- Returns:
- the traversal sideEffects of the traverser
 
 - 
getTagspublic Set<String> getTags() Description copied from interface:Traverser.AdminGet the tags associated with the traverser. Tags are used to categorize historic behavior of a traverser. The returned set is mutable.- Specified by:
- getTagsin interface- Traverser.Admin<T>
- Returns:
- the set of tags associated with the traverser.
 
 
- 
 
-