Class StringConstant

  • All Implemented Interfaces:
    ExpressionNode, Atom

    public final class StringConstant
    extends java.lang.Object
    implements Atom
    Defines a simple string constant (e.g. 'hello world').
    • Field Summary

      Modifier and Type Field Description
      static StringConstant EMPTY
      The empty string constant.
    • Constructor Summary

      Constructor Description
      StringConstant​(java.lang.String text)
      Create a string constant node.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> T accept​(NodeVisitor<T> visitor)
      Accept a visitor to process this node.
      boolean equals​(java.lang.Object obj)  
      java.lang.String getText()
      Gets the string content
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • EMPTY

        public static final StringConstant EMPTY
        The empty string constant.
    • Constructor Detail

      • StringConstant

        public StringConstant​(java.lang.String text)
        Create a string constant node.
        text - the string content (without its original quotes)
    • Method Detail

      • accept

        public <T> T accept​(NodeVisitor<T> visitor)
        Description copied from interface: ExpressionNode
        Accept a visitor to process this node.
        Specified by:
        accept in interface ExpressionNode
        Type Parameters:
        T - the type of the visitor
        visitor - The visitor
        the node after it has been evaluated by the visitor
      • getText

        public java.lang.String getText()
        Gets the string content
        Specified by:
        getText in interface Atom
        the string content
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        equals in class java.lang.Object