Package com.singularsys.jep.parser

# Class ASTOpNode

java.lang.Object
com.singularsys.jep.parser.SimpleNode
com.singularsys.jep.parser.ASTFunNode
com.singularsys.jep.parser.ASTOpNode

All Implemented Interfaces:
  `Node`

public class ASTOpNode extends ASTFunNode
Represents an operator like `+`. Children are the arguments.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface com.singularsys.jep.parser.Node

  `Node.HookKey`

- ## Field Summary

  ### Fields inherited from class com.singularsys.jep.parser.ASTFunNode

  `pfmc`

  ### Fields inherited from class com.singularsys.jep.parser.SimpleNode

  `children, id, keys, parent, vals`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ASTOpNode(int id)`
  Creates a new ASTFunNode

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getName()`
  Returns the name of the node (operator symbol or function name).
  `Operator`
  `getOperator()`
  Returns the id number of the operator if the node is an operator.
  `Object`
  `jjtAccept(ParserVisitor visitor, Object data)`
  Accept the visitor.
  `void`
  `setOperator(Operator op)`
  Sets the opID, name and pfmc for this node by looking up the values in the Operators class
  `String`
  `toString()`
  Returns a string containing the function name.

  ### Methods inherited from class com.singularsys.jep.parser.ASTFunNode

  `getPFMC, getValue, getVar, setFunction`

  ### Methods inherited from class com.singularsys.jep.parser.SimpleNode

  `childIterator, children, childrenAccept, dump, getChildren, getHook, getId, hookKeys, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtSetParent, removeHook, setHook, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### ASTOpNode

    public ASTOpNode(int id)
    Creates a new ASTFunNode

- ## Method Details

  - ### jjtAccept

    public Object jjtAccept(ParserVisitor visitor, Object data) throws JepException
    Accept the visitor.
    Specified by:
      `jjtAccept` in interface `Node`
    Overrides:
      `jjtAccept` in class `ASTFunNode`
    Throws:
      `ParseException` - on error
      `JepException`

  - ### setOperator

    public void setOperator(Operator op)
    Sets the opID, name and pfmc for this node by looking up the values in the Operators class

  - ### toString

    public String toString()
    Returns a string containing the function name.
    Overrides:
      `toString` in class `ASTFunNode`

  - ### getName

    public String getName()
    Returns the name of the node (operator symbol or function name).
    Specified by:
      `getName` in interface `Node`
    Overrides:
      `getName` in class `ASTFunNode`
    Returns:
      the name if an ASTVarNode, ASTFunNode, ASTOpNode, null otherwise

  - ### getOperator

    public Operator getOperator()
    Returns the id number of the operator if the node is an operator.
    Specified by:
      `getOperator` in interface `Node`
    Overrides:
      `getOperator` in class `ASTFunNode`
    Returns:
      The Operator for ASTOpNodes, null otherwise