Class ShortLiteralNode

All Implemented Interfaces:
org.plumelib.util.UniqueId

public class ShortLiteralNode extends ValueLiteralNode
A node for a short literal. For example:
   5
   0x8fff
 
Java source and the AST representation do not have "short" literals. They have integer literals that may be narrowed to shorts depending on context.
  • Constructor Details

    • ShortLiteralNode

      public ShortLiteralNode(LiteralTree t)
      Create a new ShortLiteralNode.
      Parameters:
      t - the tree for the literal value
  • Method Details

    • getValue

      public Short getValue()
      Description copied from class: ValueLiteralNode
      Returns the value of the literal, null for the null literal.
      Specified by:
      getValue in class ValueLiteralNode
      Returns:
      the value of the literal, null for the null literal
    • accept

      public <R, P> R accept(NodeVisitor<R,P> visitor, P p)
      Description copied from class: Node
      Accept method of the visitor pattern.
      Specified by:
      accept in class Node
      Type Parameters:
      R - result type of the operation
      P - parameter type
      Parameters:
      visitor - the visitor to be applied to this node
      p - the parameter for this operation
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class ValueLiteralNode
    • getOperands

      @SideEffectFree public Collection<Node> getOperands()
      Description copied from class: Node
      Returns a collection containing all of the operand Nodes of this Node.
      Overrides:
      getOperands in class ValueLiteralNode
      Returns:
      a collection containing all of the operand Nodes of this Node