KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > mapper > storage > VarBuildInfoSet


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.mapper.storage;
24
25 import java.util.ArrayList JavaDoc;
26 import java.util.List JavaDoc;
27
28 import org.xquark.util.NamespaceContextStack;
29
30 /**
31  * Light implementation used for the case the result table cannot be used
32  * directly.
33  */

34 public class VarBuildInfoSet implements VarInfoSet
35 {
36     private static final String JavaDoc RCSRevision = "$Revision: 1.1 $";
37     private static final String JavaDoc RCSName = "$Name: $";
38     private String JavaDoc tableName;
39     private String JavaDoc rankColumn;
40     private String JavaDoc firstColumn;
41     private String JavaDoc lastColumn;
42     private String JavaDoc pathColumn;
43     
44     /** List of column names(strings) representing colums on which the GROUP BY
45      * clause must be applied. If null, all tuples must be generated.
46      */

47     private ArrayList JavaDoc collapseColumnList = new ArrayList JavaDoc(1);
48     
49     /** List of ExpandedPathInfoSet objects representing all paths found
50      * corresponding to a reconstruction variable.
51      */

52     private ArrayList JavaDoc expandedPathList = new ArrayList JavaDoc(2);
53     
54     /** Creates new VarBuildInfoSet */
55     public VarBuildInfoSet (
56                             String JavaDoc tableName, String JavaDoc rankColumn,
57                             String JavaDoc firstColumn, String JavaDoc lastColumn,
58                             String JavaDoc pathColumn
59                             )
60     {
61         this.tableName = tableName;
62         this.rankColumn = rankColumn;
63         this.firstColumn = firstColumn;
64         this.lastColumn = lastColumn;
65         this.pathColumn = pathColumn;
66     }
67     
68     public String JavaDoc getTableName() {return tableName;}
69     public String JavaDoc getRankColumnName() {return rankColumn;}
70     public String JavaDoc getFirstColumnName() {return firstColumn;}
71     public String JavaDoc getLastColumnName() {return lastColumn;}
72     public String JavaDoc getPathColumnName() {return pathColumn;}
73     
74     public String JavaDoc getPrefix(String JavaDoc namespaceURI)
75     {
76         return null;
77     }
78     
79     public NamespaceContextStack getNamespaceContextStack()
80     {
81         return null;
82     }
83     
84     public void setCollapse(boolean collapse)
85     {
86         if (collapse)
87             addCollapseColumn(firstColumn);
88         else
89             collapseColumnList.clear();
90     }
91     
92     public void addCollapseColumn(String JavaDoc columnName)
93     {
94         collapseColumnList.add(columnName);
95     }
96     
97     public List JavaDoc getCollapseColumns()
98     {
99         return collapseColumnList;
100     }
101     
102     public void addExpandedVar(ExpandedPathInfoSet rangeInfo)
103     {
104         expandedPathList.add(rangeInfo);
105     }
106     
107     public List JavaDoc getExpandedPathList()
108     {
109         return expandedPathList;
110     }
111     
112 }
113
Popular Tags