KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > compiler > typesystem > impl > declaration > TypeParameterDeclarationImpl


1 /*
2  * Copyright 2004 The Apache Software Foundation.
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  * $Header:$
17  */

18 package org.apache.beehive.netui.compiler.typesystem.impl.declaration;
19
20 import org.apache.beehive.netui.compiler.typesystem.declaration.Declaration;
21 import org.apache.beehive.netui.compiler.typesystem.declaration.TypeParameterDeclaration;
22 import org.apache.beehive.netui.compiler.typesystem.impl.WrapperFactory;
23 import org.apache.beehive.netui.compiler.typesystem.type.ReferenceType;
24
25 import java.util.Collection JavaDoc;
26
27 public class TypeParameterDeclarationImpl
28         extends DeclarationImpl
29         implements TypeParameterDeclaration
30 {
31     private ReferenceType[] _bounds;
32     
33     public TypeParameterDeclarationImpl( com.sun.mirror.declaration.TypeParameterDeclaration delegate )
34     {
35         super( delegate );
36     }
37     
38     public ReferenceType[] getBounds()
39     {
40         if ( _bounds == null )
41         {
42             Collection JavaDoc<com.sun.mirror.type.ReferenceType> delegateCollection = getDelegate().getBounds();
43             ReferenceType[] array = new ReferenceType[delegateCollection.size()];
44             int j = 0;
45             for ( com.sun.mirror.type.ReferenceType i : delegateCollection )
46             {
47                 array[j++] = WrapperFactory.get().getReferenceType( i );
48             }
49             _bounds = array;
50         }
51
52         return _bounds;
53     }
54
55     public Declaration getOwner()
56     {
57         return WrapperFactory.get().getDeclaration( getDelegate().getOwner() );
58     }
59     
60     protected com.sun.mirror.declaration.TypeParameterDeclaration getDelegate()
61     {
62         return ( com.sun.mirror.declaration.TypeParameterDeclaration ) super.getDelegate();
63     }
64 }
65
Popular Tags