Class BottomUpImmutableNodeTransformer<SN extends Node,​DN extends Node>


  • public class BottomUpImmutableNodeTransformer<SN extends Node,​DN extends Node>
    extends java.lang.Object
    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 Detail

      • nodeMapper

        private final java.util.function.BiFunction<SN extends Node,​DN extends Node[],​DN extends Node> nodeMapper
      • mutator

        private final java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator
      • dstRootNode

        private final DN extends Node dstRootNode
      • arrayConstructor

        private final java.util.function.IntFunction<DN extends Node[]> arrayConstructor
      • stackIndex

        private int stackIndex
      • srcNodeStack

        private final SN extends Node[] srcNodeStack
      • srcNodeCursorsAndLengths

        private final int[] srcNodeCursorsAndLengths
      • mappedNodesStack

        private final java.util.Stack<DN extends Node> mappedNodesStack
      • EMPTY_DN_ARRAY

        private final DN extends Node[] EMPTY_DN_ARRAY
    • Constructor Detail

      • BottomUpImmutableNodeTransformer

        public BottomUpImmutableNodeTransformer​(SN srcRootNode,
                                                java.util.function.BiFunction<SN,​DN[],​DN> nodeMapper,
                                                java.util.function.IntFunction<DN[]> arrayConstructor)
    • Method Detail

      • applyNodeTransformation

        static final <SN extends Node,​DN extends Node> DN applyNodeTransformation​(SN rootNode,
                                                                                        java.util.function.BiFunction<SN,​DN[],​DN> nodeMapper,
                                                                                        java.util.function.IntFunction<DN[]> arrayConstructor)
      • apply

        public final DN apply()
      • isStackEmpty

        private final boolean isStackEmpty()
      • pushOnStack

        private final void pushOnStack​(SN srcNode)
      • dropFromStack

        private final void dropFromStack()
      • processStack

        private final void processStack()