1 9 10 package org.nfunk.jep; 11 12 import org.nfunk.jep.function.*; 13 16 19 public class ASTFunNode extends SimpleNode { 20 21 22 private PostfixMathCommandI pfmc; 23 24 25 private String name; 26 27 28 private Operator opID=null; 29 30 33 public ASTFunNode(int id) { 34 super(id); 35 } 36 37 40 public ASTFunNode(Parser p, int id) { 41 super(p, id); 42 } 43 44 47 public Object jjtAccept(ParserVisitor visitor, Object data) throws ParseException 48 { 49 return visitor.visit(this, data); 50 } 51 52 56 public void setFunction(String name_in, PostfixMathCommandI pfmc_in) { 57 name = name_in; 58 pfmc = pfmc_in; 59 } 60 61 65 public void setOperator(Operator op) { 66 opID = op; 67 pfmc = op.getPFMC(); 68 name = op.getName(); 69 } 70 71 74 public String toString() { 75 return "Function \"" + name + "\""; 76 } 77 78 81 public PostfixMathCommandI getPFMC() { 82 return pfmc; 83 } 84 85 88 public String getName() { 89 return name; 90 } 91 92 95 public Operator getOperator() { 96 return opID; 97 } 98 99 102 public boolean isOperator() { 103 return (opID != null); 104 } 105 } 106 | Popular Tags |