Package com.igormaznitsa.jcp.expression
Class ExpressionTree
- java.lang.Object
-
- com.igormaznitsa.jcp.expression.ExpressionTree
-
public class ExpressionTree extends java.lang.Object
The class describes an object contains an expression tree
-
-
Field Summary
Fields Modifier and Type Field Description private FilePositionInfo[]
includeStack
private ExpressionTreeElement
last
private java.lang.String
sources
-
Constructor Summary
Constructors Constructor Description ExpressionTree()
ExpressionTree(FilePositionInfo[] callStack, java.lang.String sources)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addItem(ExpressionItem item)
Add new expression item into treevoid
addTree(ExpressionTree tree)
Add whole tree as a tree element, also it sets the maximum priority to the new elementExpressionTreeElement
getRoot()
Get the root of the treeboolean
isEmpty()
Allows to check that the tree is emptyvoid
postProcess()
It can be called after the tree has been formed to optimize inside structures
-
-
-
Field Detail
-
last
private ExpressionTreeElement last
-
includeStack
private final FilePositionInfo[] includeStack
-
sources
private final java.lang.String sources
-
-
Constructor Detail
-
ExpressionTree
public ExpressionTree()
-
ExpressionTree
public ExpressionTree(@MustNotContainNull FilePositionInfo[] callStack, java.lang.String sources)
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
Allows to check that the tree is empty- Returns:
- true if the tree is empty one else false
-
addItem
public void addItem(ExpressionItem item)
Add new expression item into tree- Parameters:
item
- an item to be added, must not be null
-
addTree
public void addTree(ExpressionTree tree)
Add whole tree as a tree element, also it sets the maximum priority to the new element- Parameters:
tree
- a tree to be added as an item, must not be null
-
getRoot
public ExpressionTreeElement getRoot()
Get the root of the tree- Returns:
- the root of the tree or EMPTY_SLOT if the tree is empty
-
postProcess
public void postProcess()
It can be called after the tree has been formed to optimize inside structures
-
-