java.lang.Object
io.usethesource.capsule.core.trie.BottomUpImmutableNodeTransformer<SN,DN>
Bottom Up Trie Transformer, e.g., for combined mapping plus canonicalization of the tree.
TODO: finish implementation (WIP converting from transient to immutable transformer)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IntFunction
<DN[]> private final DN
private final DN[]
private static final int
private final AtomicReference
<Thread> private final BiFunction
<SN, DN[], DN> private final int[]
private final SN[]
private int
-
Constructor Summary
ConstructorsConstructorDescriptionBottomUpImmutableNodeTransformer
(SN srcRootNode, BiFunction<SN, DN[], DN> nodeMapper, IntFunction<DN[]> arrayConstructor) -
Method Summary
Modifier and TypeMethodDescriptionfinal DN
apply()
applyNodeTransformation
(SN rootNode, BiFunction<SN, DN[], DN> nodeMapper, IntFunction<DN[]> arrayConstructor) private final void
private final boolean
private final void
private final void
pushOnStack
(SN srcNode)
-
Field Details
-
MAX_DEPTH
private static final int MAX_DEPTH- See Also:
-
nodeMapper
-
mutator
-
dstRootNode
-
arrayConstructor
-
stackIndex
private int stackIndex -
srcNodeStack
-
srcNodeCursorsAndLengths
private final int[] srcNodeCursorsAndLengths -
mappedNodesStack
-
EMPTY_DN_ARRAY
-
-
Constructor Details
-
BottomUpImmutableNodeTransformer
public BottomUpImmutableNodeTransformer(SN srcRootNode, BiFunction<SN, DN[], DN> nodeMapper, IntFunction<DN[]> arrayConstructor)
-
-
Method Details
-
applyNodeTransformation
static final <SN extends Node,DN extends Node> DN applyNodeTransformation(SN rootNode, BiFunction<SN, DN[], DN> nodeMapper, IntFunction<DN[]> arrayConstructor) -
apply
-
isStackEmpty
private final boolean isStackEmpty() -
pushOnStack
-
dropFromStack
private final void dropFromStack() -
processStack
private final void processStack()
-