KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > xquery > typing > QTypeSequence


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

23
24 package org.xquark.xquery.typing;
25
26 import java.util.List JavaDoc;
27
28 import org.xquark.xquery.parser.XQueryException;
29
30 public class QTypeSequence extends QTypePrime implements QTypeVisitable {
31     private static final String JavaDoc RCSRevision = "$Revision: 1.3 $";
32     private static final String JavaDoc RCSName = "$Name: $";
33
34     List JavaDoc list = null;
35
36     public QTypeSequence(List JavaDoc list) {
37         super(list,SEQUENCE);
38         setList(list);
39         subclass = SEQUENCE;
40         //primeList = list;
41
this.occurence = OCC_1_1;
42     }
43     public QTypeSequence(List JavaDoc list, byte occurence) {
44         super(list,SEQUENCE);
45         setList(list);
46         subclass = SEQUENCE;
47         //primeList = list;
48
this.occurence = occurence;
49     }
50
51     // #############################################################################
52
// VISITOR STUFF
53
// #############################################################################
54

55     public void accept(QTypeVisitor visitor) throws XQueryException {
56         visitor.visit(this);
57     }
58
59     // get/set
60
public List JavaDoc getList() {
61         return list;
62     }
63
64     private void setList(List JavaDoc list) {
65         //if (list == null) throw new TypeException("list of QTypeSequence cannot be null");
66
this.list = list;
67     }
68
69     // clone
70
public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
71         QTypeSequence newObj = new QTypeSequence(list,occurence);
72         return newObj;
73     }
74     // print
75
public String JavaDoc toSimpleString() {
76         return "QTypeSequence(" + list + ")";
77     }
78
79     public String JavaDoc toString() {
80         return "QTypeSequence(" + list + ")";
81     }
82
83 }
84
Popular Tags