[]
        
(Showing Draft Content)

SyntaxNode

Class SyntaxNode

java.lang.Object
com.grapecity.documents.excel.expressions.SyntaxNode
Direct Known Subclasses:
NonTerminalNode, TerminalNode

public abstract class SyntaxNode extends Object
Represents a node in the syntax tree. The node can be terminal or non-terminal.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Clones the syntax node if the node is mutable.
    boolean
    Checks whether the SyntaxNode equal to another.
    abstract List<SyntaxNode>
    Gets children of a non-terminal node.
    int
    This object doesn't support getting hash code, because all fields are mutable.
    static SyntaxNode
    Parse(String text)
    Loads a SyntaxNode from a string that contains formula, optionallyspecifying context.
    static SyntaxNode
    Parse(String text, ParseContext context)
    Loads a SyntaxNode from a string that contains formula, optionallyspecifying context.
    Returns the formula text for this node, optionally specifying context.
    Returns the formula text for this node, optionally specifying context.

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SyntaxNode

      public SyntaxNode()
  • Method Details

    • getChildren

      public abstract List<SyntaxNode> getChildren()
      Gets children of a non-terminal node. Elements are not nullable.
      Returns:
      A list containing the child nodes of this SyntaxNode.
    • toString

      public String toString()
      Returns the formula text for this node, optionally specifying context.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the formula text for this node.
    • toString

      public String toString(UnParseContext context)
      Returns the formula text for this node, optionally specifying context.
      Parameters:
      context - Options for converting FormulaSyntaxTree tostring.
    • Parse

      public static SyntaxNode Parse(String text)
      Loads a SyntaxNode from a string that contains formula, optionallyspecifying context.
      Parameters:
      text - A string that contains formula.
      Returns:
      A SyntaxNode populated from the string that contains formula.
    • Parse

      public static SyntaxNode Parse(String text, ParseContext context)
      Loads a SyntaxNode from a string that contains formula, optionallyspecifying context.
      Parameters:
      text - A string that contains formula.
      context - A ParseContext that specifies base row, base columnand R1C1 reference style.
      Returns:
      A SyntaxNode populated from the string that contains formula.
    • equals

      public boolean equals(Object obj)
      Checks whether the SyntaxNode equal to another.
      Overrides:
      equals in class Object
      Parameters:
      obj - Another syntax node.
      Returns:
      Whether the current node equals to the specified node.
    • hashCode

      public int hashCode()
      This object doesn't support getting hash code, because all fields are mutable.
      Overrides:
      hashCode in class Object
      Returns:
      The hash code of the current type.
    • clone

      public final SyntaxNode clone()
      Clones the syntax node if the node is mutable.
      Overrides:
      clone in class Object
      Returns:
      If the node is mutable, returns the cloned object. Otherwise, returnsthe equivalent object from object pool.