KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > olap > model > impl > FunCallExprImpl


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.jpivot.olap.model.impl;
14
15 import java.util.List JavaDoc;
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 JavaDoc name;
24
25   public FunCallExprImpl() {
26   }
27
28   public FunCallExprImpl(String JavaDoc name) {
29     this.name = name;
30     this.args = new Expression[0];
31   }
32
33   public FunCallExprImpl(String JavaDoc name, Expression arg) {
34     this.name = name;
35     this.args = new Expression[] { arg };
36   }
37
38   public FunCallExprImpl(String JavaDoc name, Expression arg0, Expression arg1) {
39     this.name = name;
40     this.args = new Expression[] { arg0, arg1 };
41   }
42
43   public FunCallExprImpl(String JavaDoc 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 JavaDoc name, Expression[] args) {
49     this.name = name;
50     this.args = args;
51   }
52
53   public FunCallExprImpl(String JavaDoc name, List JavaDoc 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 JavaDoc getName() {
63     return name;
64   }
65
66   public void setArgs(Expression[] expressions) {
67     args = expressions;
68   }
69   public void setArgs(List JavaDoc list) {
70     this.args = (Expression[]) list.toArray(new Expression[list.size()]);
71   }
72
73   public void setName(String JavaDoc string) {
74     name = string;
75   }
76
77   public void accept(Visitor visitor) {
78     visitor.visitFunCallExpr(this);
79   }
80
81 }
82
Popular Tags