package org.nfunk.jep;

import org.nfunk.jep.function.PostfixMathCommandI;

public class ASTFunNode extends SimpleNode {
  private PostfixMathCommandI pfmc;
  
  private String name;
  
  private Operator opID = null;
  
  public ASTFunNode(int paramInt) {
    super(paramInt);
  }
  
  public ASTFunNode(Parser paramParser, int paramInt) {
    super(paramParser, paramInt);
  }
  
  public Object jjtAccept(ParserVisitor paramParserVisitor, Object paramObject) throws ParseException {
    return paramParserVisitor.visit(this, paramObject);
  }
  
  public void setFunction(String paramString, PostfixMathCommandI paramPostfixMathCommandI) {
    this.name = paramString;
    this.pfmc = paramPostfixMathCommandI;
  }
  
  public void setOperator(Operator paramOperator) {
    this.opID = paramOperator;
    this.pfmc = paramOperator.getPFMC();
    this.name = paramOperator.getName();
  }
  
  public String toString() {
    return "Function \"" + this.name + "\"";
  }
  
  public PostfixMathCommandI getPFMC() {
    return this.pfmc;
  }
  
  public String getName() {
    return this.name;
  }
  
  public Operator getOperator() {
    return this.opID;
  }
  
  public boolean isOperator() {
    return (this.opID != null);
  }
}
