Class ExpressionTree
java.lang.Object
com.igormaznitsa.jcp.expression.ExpressionTree
The class describes an object contains an expression tree
- Author:
- Igor Maznitsa (igor.maznitsa@igormaznitsa.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddItem(ExpressionItem item) Add new expression item into treevoidaddTree(ExpressionTree tree) Add whole tree as a tree element, also it sets the maximum priority to the new elementgetRoot()Get the root of the treebooleanisEmpty()Allows to check that the tree is emptyvoidIt can be called after the tree has been formed to optimize inside structures
-
Constructor Details
-
ExpressionTree
public ExpressionTree() -
ExpressionTree
-
-
Method Details
-
isEmpty
public boolean isEmpty()Allows to check that the tree is empty- Returns:
- true if the tree is empty one else false
-
addItem
Add new expression item into tree- Parameters:
item- an item to be added, must not be null
-
addTree
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
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
-