Package com.bazaarvoice.jolt.common.tree
Class WalkedPath
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<PathStep>
-
- com.bazaarvoice.jolt.common.tree.WalkedPath
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<PathStep>
,java.util.Collection<PathStep>
,java.util.List<PathStep>
,java.util.RandomAccess
public class WalkedPath extends java.util.ArrayList<PathStep>
DataStructure used by a SpecTransform during it's parallel tree walk. Basically this is Stack that records the steps down the tree that have been taken. For each level, there is a PathStep, which contains a pointer the data of that level, and a pointer to the LiteralPathElement matched at that level. At any given point in time, it represents where in the tree walk a Spec is operating. It is primarily used to by the ShiftrLeafSpec and CardinalityLeafSpec as a reference to lookup real values for output "&(1,1)" references. It is expected that as the SpecTransform navigates down the tree, MatchedElements will be added and then removed when that subtree has been walked.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WalkedPath()
WalkedPath(java.lang.Object treeRef, MatchedElement matchedElement)
WalkedPath(java.util.Collection<PathStep> c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(java.lang.Object treeRef, MatchedElement matchedElement)
Convenience methodPathStep
elementFromEnd(int idxFromEnd)
Method useful to "&", "&1", "&2", etc evaluation.PathStep
lastElement()
void
removeLast()
-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Constructor Detail
-
WalkedPath
public WalkedPath()
-
WalkedPath
public WalkedPath(java.util.Collection<PathStep> c)
-
WalkedPath
public WalkedPath(java.lang.Object treeRef, MatchedElement matchedElement)
-
-
Method Detail
-
add
public boolean add(java.lang.Object treeRef, MatchedElement matchedElement)
Convenience method
-
removeLast
public void removeLast()
-
elementFromEnd
public PathStep elementFromEnd(int idxFromEnd)
Method useful to "&", "&1", "&2", etc evaluation.
-
lastElement
public PathStep lastElement()
-
-