[]
        
(Showing Draft Content)

EmptyNode

Class EmptyNode


public final class EmptyNode extends TerminalNode
Represents an empty node in a formula syntax tree.

This node is used when an argument is omitted. EmptyNode is immutable, and the shared instance returned by GetInstance() is the only valid instance for public use.


 FormulaSyntaxTree syntaxTree = FormulaSyntaxTree.Parse("SUM(1,,3)");
 FunctionNode functionNode = (FunctionNode) syntaxTree.getRoot();
 EmptyNode emptyNode = (EmptyNode) functionNode.getChildren().get(1);
 boolean isSharedInstance = emptyNode == EmptyNode.GetInstance();
 
  • Constructor Details

    • EmptyNode

      public EmptyNode()
  • Method Details

    • GetInstance

      public static EmptyNode GetInstance()
      Gets the shared instance of EmptyNode.

      EmptyNode represents an omitted argument in a formula syntax tree. This method always returns the shared immutable instance for public use.

      
       FormulaSyntaxTree syntaxTree = FormulaSyntaxTree.Parse("SUM(1,,3)");
       FunctionNode functionNode = (FunctionNode) syntaxTree.getRoot();
       EmptyNode emptyNode = (EmptyNode) functionNode.getChildren().get(1);
       boolean isSharedInstance = emptyNode == EmptyNode.GetInstance();
       
      Returns:
      The shared EmptyNode instance.