public abstract class AbstractPathTraverser<T> extends Object implements Traverser<T>, Traverser.Admin<T>
Traverser.Admin<T>| Modifier and Type | Field and Description |
|---|---|
protected long |
bulk |
protected String |
future |
protected short |
loops |
protected Path |
path |
protected Object |
sack |
protected TraversalSideEffects |
sideEffects |
protected T |
t |
HALT| Modifier | Constructor and Description |
|---|---|
protected |
AbstractPathTraverser() |
|
AbstractPathTraverser(T t,
Step<T,?> step) |
| Modifier and Type | Method and Description |
|---|---|
Traverser.Admin<T> |
attach(Vertex vertex)
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.
|
AbstractPathTraverser<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.
|
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(String stepLabel)
Increment the number of times the traverser has gone through a looping section of traversal.
|
int |
loops()
Return the number of times the traverser has gone through a looping section of a traversal.
|
void |
merge(Traverser.Admin<?> other)
When two traversers are
Traverser#equals to 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() |
equals, finalize, getClass, notify, notifyAll, wait, wait, waitattach, isHaltedasAdmin, compareTo, path, sideEffects, sideEffectsprotected T t
protected Object sack
protected String future
protected short loops
protected transient TraversalSideEffects sideEffects
protected long bulk
protected Path path
public T get()
Traverserpublic void set(T t)
Traverser.Adminset in interface Traverser.Admin<T>t - The current object of the traverserpublic Path path()
Traverserpublic <S> S sack()
Traverserpublic <S> void sack(S object)
Traverserpublic void setBulk(long count)
Traverser.AdminsetBulk in interface Traverser.Admin<T>count - the number of traverserspublic long bulk()
Traverserpublic int loops()
Traverserpublic void incrLoops(String stepLabel)
Traverser.AdminincrLoops in interface Traverser.Admin<T>stepLabel - the label of the step that is doing the incrementingpublic void resetLoops()
Traverser.AdminresetLoops in interface Traverser.Admin<T>public String getStepId()
Traverser.AdmingetStepId in interface Traverser.Admin<T>public void setStepId(String stepId)
Traverser.AdminTraverser.Admin.HALT, then Traverser.Admin.isHalted() is true.setStepId in interface Traverser.Admin<T>stepId - The future step of the traverserpublic TraversalSideEffects getSideEffects()
Traverser.AdmingetSideEffects in interface Traverser.Admin<T>public void setSideEffects(TraversalSideEffects sideEffects)
Traverser.AdminTraversal. 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 Traverser.Admin<T> detach()
Traverser.Admindetach in interface Traverser.Admin<T>public Traverser.Admin<T> attach(Vertex vertex)
Traverser.Adminattach in interface Traverser.Admin<T>attach in interface Attachable<Traverser.Admin<T>>vertex - The vertex that is hosting the traverserpublic void merge(Traverser.Admin<?> other)
Traverser.AdminTraverser#equals to 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.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.Adminsplit 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.Adminsplit in interface Traverser.Admin<T>public AbstractPathTraverser<T> clone()
TraverserCopyright © 2013–2015 Apache Software Foundation. All rights reserved.