1 26 27 package org.objectweb.openccm.ast.lib; 28 29 30 import org.objectweb.openccm.ast.api.TypeRef; 31 32 33 import org.objectweb.openccm.ast.api.Declaration; 34 35 43 44 public class TypeRefWithContentImpl 45 extends TypeRefWithLengthImpl 46 implements org.objectweb.openccm.ast.api.TypeRefWithContent 47 { 48 54 55 private TypeRef content_; 56 57 63 71 protected 72 TypeRefWithContentImpl(org.omg.CORBA.IDLType type, 73 org.objectweb.openccm.ast.api.TypeKind kind, 74 int length, 75 TypeRef content) 76 { 77 super(type, kind, length); 79 80 content_ = content; 82 } 83 84 90 96 102 107 public Declaration[] 108 getDependencies() 109 { 110 if (dependencies_!=null) 111 return dependencies_; 112 113 if (content_.isDeclaration()) 114 { 115 Declaration[] depend = content_.getDependencies(); 116 Declaration[] depend2 = new Declaration[1+depend.length]; 117 for (int i=0;i<depend.length;i++) 118 depend2[i] = depend[i]; 119 120 depend2[depend.length] = (Declaration)content_; 121 dependencies_ = depend2; 122 } 123 else 124 dependencies_ = content_.getDependencies(); 125 126 return dependencies_; 127 } 128 129 135 140 public void 141 setContentType(TypeRef content) 142 { 143 content_ = content; 144 } 145 146 151 public TypeRef 152 getContentType() 153 { 154 return content_; 155 } 156 } 157 | Popular Tags |