Class Symbol

All Implemented Interfaces:
Stringable

public class Symbol extends ImmutableLiteral implements Stringable
  • Field Details

    • KW_REST_ARG_DUMMY

      public static final Symbol KW_REST_ARG_DUMMY
  • Constructor Details

  • Method Details

    • equals

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

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

      public OperandType getOperandType()
      Specified by:
      getOperandType in class Operand
    • getBytes

      public ByteList getBytes()
    • getSymbol

      public RubySymbol getSymbol()
    • getString

      public String getString()
      Specified by:
      getString in interface Stringable
    • createCacheObject

      public Object createCacheObject(ThreadContext context)
      Description copied from class: ImmutableLiteral
      Implementing class is responsible for constructing the cached value.
      Specified by:
      createCacheObject in class ImmutableLiteral
    • canCopyPropagate

      public boolean canCopyPropagate()
      Description copied from class: Operand
      Can we replace every use of a variable 'v' that contains the value of this operand with the operand itself? This takes importance when there are at least two uses of 'v' within this scope. Ex: v = [1,2,3]; x = v; y = v In this case, we cannot replace the occurrences of 'v' because we would then get x = [1,2,3]; y = [1,2,3] which would then result in two different array objects being constructed instead of a single one.
      Overrides:
      canCopyPropagate in class ImmutableLiteral
      Returns:
      true if it is safe to copy-propagate the operand.
    • getEncoding

      public org.jcodings.Encoding getEncoding()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • encode

      public void encode(IRWriterEncoder e)
      Overrides:
      encode in class Operand
    • decode

      public static Symbol decode(IRReaderDecoder d)
    • visit

      public void visit(IRVisitor visitor)
      Overrides:
      visit in class Operand
    • isTruthyImmediate

      public boolean isTruthyImmediate()
      Description copied from class: Operand
      Returns true if this is an immediate value that will always be considered truthy (true, numbers, etc)
      Overrides:
      isTruthyImmediate in class Operand
      Returns: