Package org.cytoscape.equations
Interface TreeNode
- All Known Implementing Classes:
AbstractNode
public interface TreeNode
The interface for a node within the Equation parse tree.
Module: equations-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>equations-api</artifactId> </dependency>
Cytoscape Backwards Compatibility (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
genCode
(Stack<CodeAndSourceLocation> codeStack) Generated code for this node and pushes it onto the execution stack.Returns the left child if it exists or null if it doesn't.Returns the right child if it exists or null if it doesn't.int
Returns the start of the location in the equation where the code was found that was turned into a node in the parse tree.getType()
Returns the type of this node.
-
Method Details
-
getSourceLocation
int getSourceLocation()Returns the start of the location in the equation where the code was found that was turned into a node in the parse tree.- Returns:
- the location in the source code that resulted in this node
-
getType
Class getType()Returns the type of this node.- Returns:
- the type of the result of the code generated from this node will result in
-
getLeftChild
TreeNode getLeftChild()Returns the left child if it exists or null if it doesn't.- Returns:
- the left child, if any, of this node in the parse tree
-
getRightChild
TreeNode getRightChild()Returns the right child if it exists or null if it doesn't.- Returns:
- the right child, if any, of this node in the parse tree
-
genCode
Generated code for this node and pushes it onto the execution stack.- Parameters:
codeStack
- the execution stack to push the generated code for this node.
-