KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > extractor > sql > SqlFunction


1 /*
2  * This file belongs to the XQuark distribution.
3  * Copyright (C) 2003 Universite de Versailles Saint-Quentin.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307.
18  * You can also get it at http://www.gnu.org/licenses/lgpl.html
19  *
20  * For more information on this software, see http://www.xquark.org.
21  */

22
23 package org.xquark.extractor.sql;
24
25
26 import java.util.ArrayList JavaDoc;
27 import java.util.List JavaDoc;
28
29
30 public class SqlFunction extends SqlExpression
31 {
32
33     private static final String JavaDoc RCSRevision = "$Revision: 1.3 $";
34     private static final String JavaDoc RCSName = "$Name: $";
35
36     private String JavaDoc _name;
37     protected List JavaDoc _arguments;
38
39     /**
40     @roseuid 3BD1465C02E6
41      */

42     public SqlFunction()
43     {
44     }
45
46     public SqlFunction(String JavaDoc functionName)
47     {
48         setName(functionName);
49     }
50
51     /**
52     @param name
53     @param arguments
54     @roseuid 3BD143B8028A
55      */

56     public SqlFunction(String JavaDoc functionName, List JavaDoc arguments)
57     {
58         setName(functionName);
59         setArguments(arguments);
60     }
61
62     /**
63     Access method for the _name property.
64
65     @return the current value of the _name property
66      */

67     public String JavaDoc getName()
68     {
69         return _name;
70     }
71
72     /**
73     Sets the value of the _name property.
74
75     @param aName the new value of the _name property
76      */

77     public void setName(String JavaDoc aName)
78     {
79         _name = aName;
80     }
81
82     /**
83     Access method for the _arguments property.
84
85     @return the current value of the _arguments property
86      */

87     public List JavaDoc getArguments()
88     {
89         return _arguments;
90     }
91
92     /**
93     Sets the value of the _arguments property.
94
95     @param aArguments the new value of the _arguments property
96      */

97     public void setArguments(List JavaDoc aArguments)
98     {
99         _arguments = aArguments;
100     }
101
102     /**
103     @return SqlExpression
104     @roseuid 3BD1456B0091
105      */

106     public SqlExpression getArgument(int index )
107     {
108      return (SqlExpression)_arguments.get(index);
109     }
110
111     /**
112     @param operand
113     @roseuid 3BD1457C0103
114      */

115     public void setArgument(int index ,SqlExpression operand)
116     {
117         if (null == _arguments ) {
118             _arguments = new ArrayList JavaDoc();
119         }
120         while (_arguments.size()<index+1 ) {
121             _arguments.add(null);
122         }
123         _arguments.set(index,operand);
124     }
125
126     public int getArgumentNumber()
127     {
128         if (null == _arguments) {
129             return 0;
130         }
131         else {
132             return _arguments.size();
133         }
134     }
135
136
137 }
138
139
Popular Tags