Package org.jruby.ast

Class FixnumNode

All Implemented Interfaces:
LiteralValue, SideEffectFree, ILiteralNode

public class FixnumNode extends NumericNode implements ILiteralNode, SideEffectFree
Represents an integer literal.
  • Constructor Details

    • FixnumNode

      public FixnumNode(int line, long value)
  • Method Details

    • accept

      public <T> T accept(NodeVisitor<T> iVisitor)
      Specified by:
      accept in class Node
    • getNodeType

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

      public NumericNode negate()
      Overrides:
      negate in class NumericNode
    • getValue

      public long getValue()
      Gets the value.
      Returns:
      Returns a long
    • setValue

      public void setValue(long value)
    • childNodes

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

      public String toStringExtraInfo()
      Description copied from class: Node
      Not all interesting info in the AST is from Node data. This method will print out anything else of note (e.g. FixnumNode's long value).
      Overrides:
      toStringExtraInfo in class Node
      Returns:
      null for no extra info or something otherwise.
    • equals

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

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

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