KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > sql99 > expression > expressionprimary > identifierchain


1 package com.daffodilwoods.daffodildb.server.sql99.expression.expressionprimary;
2
3 import java.util.*;
4
5 import com.daffodilwoods.daffodildb.server.sql99.expression.rowvalueexpression.*;
6 import com.daffodilwoods.database.resource.*;
7
8 public class identifierchain extends AbstractRowValueExpression implements com.daffodilwoods.daffodildb.utils.parser.StatementExecuter {
9
10    public Speriod_991726143identifier[] _OptRepSperiod_991726143identifier0;
11    public identifier _identifier1;
12
13    public Object JavaDoc run(Object JavaDoc object) throws com.daffodilwoods.database.resource.DException {
14       if (_OptRepSperiod_991726143identifier0 != null) {
15          return gettingIdentifiers(object);
16       }
17       return new String JavaDoc[] { ( (String JavaDoc) _identifier1.run(object))};
18    }
19
20    private String JavaDoc[] gettingIdentifiers(Object JavaDoc object) throws DException {
21       int length = _OptRepSperiod_991726143identifier0.length;
22       ArrayList listOfIdentifiers = new ArrayList(length + 1);
23       listOfIdentifiers.add( ( (String JavaDoc) _identifier1.run(object)));
24       for (int i = 0; i < length; i++) {
25          listOfIdentifiers.add( ( (String JavaDoc) _OptRepSperiod_991726143identifier0[i].run(object)));
26       }
27       return (String JavaDoc[]) listOfIdentifiers.toArray(new String JavaDoc[length + 1]);
28    }
29
30    public AbstractRowValueExpression[] getChilds() {
31       AbstractRowValueExpression[] childs = new AbstractRowValueExpression[] {};
32       return childs;
33
34    }
35
36    public String JavaDoc toString() {
37       StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
38       sb.append(" ");
39       sb.append(_identifier1);
40       if (_OptRepSperiod_991726143identifier0 != null) {
41          for (int i = 0; i < _OptRepSperiod_991726143identifier0.length; i++) {
42             sb.append(_OptRepSperiod_991726143identifier0[i]);
43          }
44       }
45       else
46         sb.append(" ");
47       return sb.toString();
48    }
49
50    public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
51       identifierchain tempClass = new identifierchain();
52       if (_OptRepSperiod_991726143identifier0 != null) {
53          Speriod_991726143identifier[] temp_OptRepSperiod_991726143identifier0 = new Speriod_991726143identifier[_OptRepSperiod_991726143identifier0.length];
54          for (int i = 0; i < _OptRepSperiod_991726143identifier0.length; i++) {
55             temp_OptRepSperiod_991726143identifier0[i] = (Speriod_991726143identifier) _OptRepSperiod_991726143identifier0[i].clone();
56          }
57          tempClass._OptRepSperiod_991726143identifier0 = temp_OptRepSperiod_991726143identifier0;
58       }
59       tempClass._identifier1 = (identifier) _identifier1.clone();
60       return tempClass;
61    }
62
63 }
64
Popular Tags