Package org.jruby.ast

Class StrNode

java.lang.Object
org.jruby.ast.Node
org.jruby.ast.StrNode
All Implemented Interfaces:
LiteralValue, SideEffectFree, ILiteralNode
Direct Known Subclasses:
FileNode

public class StrNode extends Node implements ILiteralNode, LiteralValue, SideEffectFree
Representing a simple String literal.
  • Constructor Details

    • StrNode

      public StrNode(int line, ByteList value)
    • StrNode

      public StrNode(int line, ByteList value, int codeRange, StringStyle stringStyle)
    • StrNode

      public StrNode(int line, StrNode head, StrNode tail)
  • Method Details

    • getNodeType

      public NodeType getNodeType()
      Specified by:
      getNodeType in class Node
      Returns:
      the nodeId
    • accept

      public <T> T accept(NodeVisitor<T> iVisitor)
      Accept for the visitor pattern.
      Specified by:
      accept in class Node
      Parameters:
      iVisitor - the visitor
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getValue

      public ByteList getValue()
      Gets the value.
      Returns:
      Returns a String
    • getCodeRange

      public int getCodeRange()
      Get the string's coderange.
      Returns:
      the string's coderange
    • childNodes

      public List<Node> childNodes()
      Specified by:
      childNodes in class Node
    • getStringStyle

      public StringStyle getStringStyle()
    • setStringStyle

      public void setStringStyle(StringStyle stringStyle)
    • literalValue

      public IRubyObject literalValue(Ruby runtime)
      Specified by:
      literalValue in interface LiteralValue