KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jdo > spi > persistence > support > sqlstore > query > util > scope > Nesting


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * Nesting.java
26  *
27  * Created on March 8, 2000
28  */

29
30 package com.sun.jdo.spi.persistence.support.sqlstore.query.util.scope;
31
32 import java.util.ArrayList JavaDoc;
33 import java.util.Iterator JavaDoc;
34 import java.util.List JavaDoc;
35
36 /**
37  * This class is used to handle the hidden definition
38  * of an identifier. If an identifier is declared its old
39  * definition is hidden and stored in the actual nesting.
40  *
41  * @author Michael Bouschen
42  * @version 0.1
43  */

44 public class Nesting
45 {
46     /**
47      * List of idents with hidden definitions in the actual scope.
48      */

49     protected List JavaDoc idents;
50     
51     /**
52      * List of hidden definitions; each definition in this list
53      * corresponds to an identifier of the list idents.
54      */

55     protected List JavaDoc hiddenDefs;
56
57     /**
58      * Creates an new nesting.
59      */

60     public Nesting()
61     {
62         this.idents = new ArrayList JavaDoc();
63         this.hiddenDefs = new ArrayList JavaDoc();
64     }
65
66     /**
67      * Adds a hidden definition to this.
68      * @param ident name of the identifier
69      * @param hidden the hidden definition of ident
70      */

71     public void add(String JavaDoc ident, Definition hidden)
72     {
73         idents.add(ident);
74         hiddenDefs.add(hidden);
75     }
76
77     /**
78      * Returns an enumeration of idents with hidden definitions.
79      */

80     public Iterator JavaDoc getIdents()
81     {
82         return idents.iterator();
83     }
84
85     /**
86      * Returns an enumeration of hidden definitions.
87      */

88     public Iterator JavaDoc getHiddenDefinitions()
89     {
90         return hiddenDefs.iterator();
91     }
92 }
93
Popular Tags