KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > query > model > ValueExprList


1 /*
2  * Copyright 2004 Outerthought bvba and Schaubroeck nv
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.outerj.daisy.query.model;
17
18 import org.outerj.daisy.query.QueryContext;
19 import org.outerj.daisy.repository.query.QueryException;
20
21 import java.util.ArrayList JavaDoc;
22 import java.util.Iterator JavaDoc;
23
24 public final class ValueExprList {
25     private final ArrayList JavaDoc valueExprs = new ArrayList JavaDoc();
26
27     public void add(ValueExpr valueExpr) {
28         valueExprs.add(valueExpr);
29     }
30
31     void prepare(QueryContext context) throws QueryException {
32         Iterator JavaDoc valueExprIt = valueExprs.iterator();
33         while (valueExprIt.hasNext()) {
34             ValueExpr valueExpr = (ValueExpr)valueExprIt.next();
35             valueExpr.prepare(context);
36         }
37     }
38
39     public ValueExpr[] getArray() {
40         return (ValueExpr[])valueExprs.toArray(new ValueExpr[valueExprs.size()]);
41     }
42 }
43
Popular Tags