1 13 package com.tonbeller.jpivot.olap.model.impl; 14 15 import java.util.List ; 16 17 import com.tonbeller.jpivot.olap.model.Expression; 18 import com.tonbeller.jpivot.olap.model.FunCallExpr; 19 import com.tonbeller.jpivot.olap.model.Visitor; 20 21 public class FunCallExprImpl implements FunCallExpr { 22 private Expression[] args; 23 private String name; 24 25 public FunCallExprImpl() { 26 } 27 28 public FunCallExprImpl(String name) { 29 this.name = name; 30 this.args = new Expression[0]; 31 } 32 33 public FunCallExprImpl(String name, Expression arg) { 34 this.name = name; 35 this.args = new Expression[] { arg }; 36 } 37 38 public FunCallExprImpl(String name, Expression arg0, Expression arg1) { 39 this.name = name; 40 this.args = new Expression[] { arg0, arg1 }; 41 } 42 43 public FunCallExprImpl(String name, Expression arg0, Expression arg1, Expression arg2) { 44 this.name = name; 45 this.args = new Expression[] { arg0, arg1, arg2 }; 46 } 47 48 public FunCallExprImpl(String name, Expression[] args) { 49 this.name = name; 50 this.args = args; 51 } 52 53 public FunCallExprImpl(String name, List args) { 54 this.name = name; 55 this.args = (Expression[]) args.toArray(new Expression[args.size()]); 56 } 57 58 public Expression[] getArgs() { 59 return args; 60 } 61 62 public String getName() { 63 return name; 64 } 65 66 public void setArgs(Expression[] expressions) { 67 args = expressions; 68 } 69 public void setArgs(List list) { 70 this.args = (Expression[]) list.toArray(new Expression[list.size()]); 71 } 72 73 public void setName(String string) { 74 name = string; 75 } 76 77 public void accept(Visitor visitor) { 78 visitor.visitFunCallExpr(this); 79 } 80 81 } 82 | Popular Tags |