public abstract class AbstractTraverser<T> extends Object implements Traverser<T>, Traverser.Admin<T>
Traverser.Admin<T>
Attachable.Exceptions, Attachable.Method
Modifier and Type | Field and Description |
---|---|
protected T |
t |
HALT
Modifier | Constructor and Description |
---|---|
protected |
AbstractTraverser() |
|
AbstractTraverser(T t) |
Modifier and Type | Method and Description |
---|---|
void |
addLabels(Set<String> labels) |
T |
attach(Function<Attachable<T>,T> method)
Regenerate the detached traverser given its location at a particular vertex.
|
long |
bulk()
A traverser may represent a grouping of traversers to allow for more efficient data propagation.
|
AbstractTraverser<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.
|
void |
dropLabels(Set<String> labels)
Drop all path information associated with specified labels.
|
void |
dropPath()
Drop the path of the traverser.
|
boolean |
equals(Object object) |
T |
get()
Get the object that the traverser is current at.
|
TraversalSideEffects |
getSideEffects()
Get the sideEffects associated with the traversal of the traverser.
|
String |
getStepId()
Get the step id of where the traverser is located.
|
int |
hashCode() |
void |
incrLoops()
Increment the number of times the traverser has gone through a looping section of traversal.
|
void |
initialiseLoops(String stepLabel,
String loopName)
Initialise a loop by setting up the looping construct.
|
void |
keepLabels(Set<String> labels)
Drop all path information not associated with specified labels.
|
int |
loops()
Return the number of times the traverser has gone through a looping section of a traversal.
|
int |
loops(String loopName)
Return the number of times the traverser has gone through the named looping section of a traversal.
|
void |
merge(Traverser.Admin<?> other)
When two traversers are have equality with each other, then they can be merged.
|
Path |
path()
Get the current path of the traverser.
|
void |
resetLoops()
Set the number of times the traverser has gone through a loop back to 0.
|
<S> S |
sack()
Get the sack local sack object of this traverser.
|
<S> void |
sack(S object)
Set the traversers sack object to the provided value ("sack the value").
|
void |
set(T t)
Set the current object location of the traverser.
|
void |
setBulk(long count)
Set the number of traversers represented by this traverser.
|
void |
setSideEffects(TraversalSideEffects sideEffects)
Set the sideEffects of the
Traversal . |
void |
setStepId(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.
|
String |
toString() |
finalize, getClass, notify, notifyAll, wait, wait, wait
getLoopNames, getTags, isHalted
asAdmin, compareTo, path, path, sideEffects, sideEffects
protected T t
protected AbstractTraverser()
public AbstractTraverser(T t)
public void merge(Traverser.Admin<?> other)
Traverser.Admin
merge
in interface Traverser.Admin<T>
other
- the other traverser to merge into this traverser. Once merged, the other can be garbage collected.public <R> Traverser.Admin<R> split(R r, Step<T,R> step)
Traverser.Admin
split
in interface Traverser.Admin<T>
R
- The current object type of the childr
- The current object of the childstep
- The step yielding the splitpublic Traverser.Admin<T> split()
Traverser.Admin
split
in interface Traverser.Admin<T>
public void addLabels(Set<String> labels)
addLabels
in interface Traverser.Admin<T>
public void keepLabels(Set<String> labels)
Traverser.Admin
keepLabels
in interface Traverser.Admin<T>
labels
- the labels to keep path information for.public void dropLabels(Set<String> labels)
Traverser.Admin
dropLabels
in interface Traverser.Admin<T>
labels
- the labels to drop path information for.public void dropPath()
Traverser.Admin
dropPath
in interface Traverser.Admin<T>
public void set(T t)
Traverser.Admin
set
in interface Traverser.Admin<T>
t
- The current object of the traverserpublic void initialiseLoops(String stepLabel, String loopName)
Traverser.Admin
LoopsStep
initialiseLoops
in interface Traverser.Admin<T>
stepLabel
- the label of the step that is being set-up.loopName
- the user defined name for referencing the loop counter or null if not setpublic void incrLoops()
Traverser.Admin
incrLoops
in interface Traverser.Admin<T>
public void resetLoops()
Traverser.Admin
resetLoops
in interface Traverser.Admin<T>
public String getStepId()
Traverser.Admin
getStepId
in interface Traverser.Admin<T>
public void setStepId(String stepId)
Traverser.Admin
Traverser.Admin.HALT
, then Traverser.Admin.isHalted()
is true.setStepId
in interface Traverser.Admin<T>
stepId
- The future step of the traverserpublic void setBulk(long count)
Traverser.Admin
setBulk
in interface Traverser.Admin<T>
count
- the number of traverserspublic Traverser.Admin<T> detach()
Traverser.Admin
detach
in interface Traverser.Admin<T>
public T attach(Function<Attachable<T>,T> method)
Traverser.Admin
attach
in interface Traverser.Admin<T>
attach
in interface Attachable<T>
method
- The method by which to attach a Traverser
to an vertex.public void setSideEffects(TraversalSideEffects sideEffects)
Traverser.Admin
Traversal
. Given that traversers can move between machines,
it may be important to re-set this when the traverser crosses machine boundaries.setSideEffects
in interface Traverser.Admin<T>
sideEffects
- the sideEffects of the traversal.public TraversalSideEffects getSideEffects()
Traverser.Admin
getSideEffects
in interface Traverser.Admin<T>
public T get()
Traverser
public <S> S sack()
Traverser
public <S> void sack(S object)
Traverser
public Path path()
Traverser
public int loops()
Traverser
public int loops(String loopName)
Traverser
public long bulk()
Traverser
public AbstractTraverser<T> clone()
Traverser
Copyright © 2013–2022 Apache Software Foundation. All rights reserved.