Search in sources :

Example 6 with UnaryTreeNode

use of com.alibaba.maxgraph.compiler.tree.UnaryTreeNode in project GraphScope by alibaba.

the class TreeNodeUtils method buildTreeNodeListFromLeaf.

/**
 * Parse tree node list from leaf node
 *
 * @param leafNode The given leaf node
 * @return The tree node list
 */
public static List<TreeNode> buildTreeNodeListFromLeaf(TreeNode leafNode) {
    TreeNode currentNode = leafNode;
    LinkedList<TreeNode> treeNodeList = Lists.newLinkedList();
    while (!(currentNode instanceof SourceTreeNode)) {
        treeNodeList.addFirst(currentNode);
        currentNode = ((UnaryTreeNode) currentNode).getInputNode();
    }
    treeNodeList.addFirst(currentNode);
    return treeNodeList;
}
Also used : SourceTreeNode(com.alibaba.maxgraph.compiler.tree.source.SourceTreeNode) VertexTreeNode(com.alibaba.maxgraph.compiler.tree.VertexTreeNode) MaxTreeNode(com.alibaba.maxgraph.compiler.tree.MaxTreeNode) RangeGlobalTreeNode(com.alibaba.maxgraph.compiler.tree.RangeGlobalTreeNode) FoldTreeNode(com.alibaba.maxgraph.compiler.tree.FoldTreeNode) TreeNode(com.alibaba.maxgraph.compiler.tree.TreeNode) TokenTreeNode(com.alibaba.maxgraph.compiler.tree.TokenTreeNode) MinTreeNode(com.alibaba.maxgraph.compiler.tree.MinTreeNode) CountGlobalTreeNode(com.alibaba.maxgraph.compiler.tree.CountGlobalTreeNode) HasTreeNode(com.alibaba.maxgraph.compiler.tree.HasTreeNode) SelectOneTreeNode(com.alibaba.maxgraph.compiler.tree.SelectOneTreeNode) PropertyMapTreeNode(com.alibaba.maxgraph.compiler.tree.PropertyMapTreeNode) SumTreeNode(com.alibaba.maxgraph.compiler.tree.SumTreeNode) UnaryTreeNode(com.alibaba.maxgraph.compiler.tree.UnaryTreeNode) SourceTreeNode(com.alibaba.maxgraph.compiler.tree.source.SourceTreeNode)

Aggregations

TreeNode (com.alibaba.maxgraph.compiler.tree.TreeNode)6 UnaryTreeNode (com.alibaba.maxgraph.compiler.tree.UnaryTreeNode)6 SelectOneTreeNode (com.alibaba.maxgraph.compiler.tree.SelectOneTreeNode)5 SourceTreeNode (com.alibaba.maxgraph.compiler.tree.source.SourceTreeNode)5 RangeGlobalTreeNode (com.alibaba.maxgraph.compiler.tree.RangeGlobalTreeNode)4 CountGlobalTreeNode (com.alibaba.maxgraph.compiler.tree.CountGlobalTreeNode)3 FoldTreeNode (com.alibaba.maxgraph.compiler.tree.FoldTreeNode)3 HasTreeNode (com.alibaba.maxgraph.compiler.tree.HasTreeNode)3 MaxTreeNode (com.alibaba.maxgraph.compiler.tree.MaxTreeNode)3 MinTreeNode (com.alibaba.maxgraph.compiler.tree.MinTreeNode)3 PropertyMapTreeNode (com.alibaba.maxgraph.compiler.tree.PropertyMapTreeNode)3 SumTreeNode (com.alibaba.maxgraph.compiler.tree.SumTreeNode)3 TokenTreeNode (com.alibaba.maxgraph.compiler.tree.TokenTreeNode)3 VertexTreeNode (com.alibaba.maxgraph.compiler.tree.VertexTreeNode)3 RepeatTreeNode (com.alibaba.maxgraph.compiler.tree.RepeatTreeNode)2 SelectTreeNode (com.alibaba.maxgraph.compiler.tree.SelectTreeNode)2 UnionTreeNode (com.alibaba.maxgraph.compiler.tree.UnionTreeNode)2 WherePredicateTreeNode (com.alibaba.maxgraph.compiler.tree.WherePredicateTreeNode)2 Message (com.alibaba.maxgraph.Message)1 LogicalBinaryVertex (com.alibaba.maxgraph.compiler.logical.LogicalBinaryVertex)1