001 /* This file was generated with JastAdd2 (http://jastadd.org) version 2.1.13-12-g880e696 */ 002 package org.extendj.ast; 003 004 import java.util.HashSet; 005 import java.io.File; 006 import java.util.Set; 007 import java.util.Collections; 008 import java.util.Collection; 009 import java.util.ArrayList; 010 import beaver.*; 011 import java.util.*; 012 import java.io.ByteArrayOutputStream; 013 import java.io.PrintStream; 014 import java.lang.reflect.InvocationTargetException; 015 import java.lang.reflect.Method; 016 import org.jastadd.util.*; 017 import java.util.zip.*; 018 import java.io.*; 019 import org.jastadd.util.PrettyPrintable; 020 import org.jastadd.util.PrettyPrinter; 021 import java.io.FileNotFoundException; 022 import java.io.BufferedInputStream; 023 import java.io.DataInputStream; 024 /** 025 * @ast node 026 * @declaredat /home/jesper/git/extendj/java5/grammar/Generics.ast:49 027 * @production WildcardsCompilationUnit : {@link CompilationUnit}; 028 029 */ 030 public class WildcardsCompilationUnit extends CompilationUnit implements Cloneable { 031 /** 032 * @aspect LookupParTypeDecl 033 * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1522 034 */ 035 public static LUBType createLUBType(Collection bounds) { 036 List boundList = new List(); 037 StringBuilder name = new StringBuilder(); 038 for (Iterator iter = bounds.iterator(); iter.hasNext(); ) { 039 TypeDecl typeDecl = (TypeDecl) iter.next(); 040 boundList.add(typeDecl.createBoundAccess()); 041 name.append("& " + typeDecl.typeName()); 042 } 043 LUBType decl = new LUBType( 044 new Modifiers(new List().add(new Modifier("public"))), 045 name.toString(), 046 new List(), 047 boundList 048 ); 049 return decl; 050 } 051 /** 052 * @declaredat ASTNode:1 053 */ 054 public WildcardsCompilationUnit() { 055 super(); 056 } 057 /** 058 * Initializes the child array to the correct size. 059 * Initializes List and Opt nta children. 060 * @apilevel internal 061 * @ast method 062 * @declaredat ASTNode:10 063 */ 064 public void init$Children() { 065 children = new ASTNode[2]; 066 setChild(new List(), 0); 067 setChild(new List(), 1); 068 } 069 /** 070 * @declaredat ASTNode:15 071 */ 072 public WildcardsCompilationUnit(String p0, List<ImportDecl> p1, List<TypeDecl> p2) { 073 setPackageDecl(p0); 074 setChild(p1, 0); 075 setChild(p2, 1); 076 } 077 /** 078 * @declaredat ASTNode:20 079 */ 080 public WildcardsCompilationUnit(beaver.Symbol p0, List<ImportDecl> p1, List<TypeDecl> p2) { 081 setPackageDecl(p0); 082 setChild(p1, 0); 083 setChild(p2, 1); 084 } 085 /** 086 * @apilevel low-level 087 * @declaredat ASTNode:28 088 */ 089 protected int numChildren() { 090 return 2; 091 } 092 /** 093 * @apilevel internal 094 * @declaredat ASTNode:34 095 */ 096 public boolean mayHaveRewrite() { 097 return false; 098 } 099 /** 100 * @apilevel internal 101 * @declaredat ASTNode:40 102 */ 103 public void flushAttrCache() { 104 super.flushAttrCache(); 105 typeWildcard_reset(); 106 lookupWildcardExtends_TypeDecl_reset(); 107 lookupWildcardSuper_TypeDecl_reset(); 108 lookupLUBType_Collection_reset(); 109 lookupGLBType_ArrayList_reset(); 110 } 111 /** 112 * @apilevel internal 113 * @declaredat ASTNode:51 114 */ 115 public void flushCollectionCache() { 116 super.flushCollectionCache(); 117 } 118 /** 119 * @apilevel internal 120 * @declaredat ASTNode:57 121 */ 122 public void flushRewriteCache() { 123 super.flushRewriteCache(); 124 } 125 /** 126 * @apilevel internal 127 * @declaredat ASTNode:63 128 */ 129 public WildcardsCompilationUnit clone() throws CloneNotSupportedException { 130 WildcardsCompilationUnit node = (WildcardsCompilationUnit) super.clone(); 131 return node; 132 } 133 /** 134 * @apilevel internal 135 * @declaredat ASTNode:70 136 */ 137 public WildcardsCompilationUnit copy() { 138 try { 139 WildcardsCompilationUnit node = (WildcardsCompilationUnit) clone(); 140 node.parent = null; 141 if (children != null) { 142 node.children = (ASTNode[]) children.clone(); 143 } 144 return node; 145 } catch (CloneNotSupportedException e) { 146 throw new Error("Error: clone not supported for " + getClass().getName()); 147 } 148 } 149 /** 150 * Create a deep copy of the AST subtree at this node. 151 * The copy is dangling, i.e. has no parent. 152 * @return dangling copy of the subtree at this node 153 * @apilevel low-level 154 * @deprecated Please use treeCopy or treeCopyNoTransform instead 155 * @declaredat ASTNode:89 156 */ 157 @Deprecated 158 public WildcardsCompilationUnit fullCopy() { 159 return treeCopyNoTransform(); 160 } 161 /** 162 * Create a deep copy of the AST subtree at this node. 163 * The copy is dangling, i.e. has no parent. 164 * @return dangling copy of the subtree at this node 165 * @apilevel low-level 166 * @declaredat ASTNode:99 167 */ 168 public WildcardsCompilationUnit treeCopyNoTransform() { 169 WildcardsCompilationUnit tree = (WildcardsCompilationUnit) copy(); 170 if (children != null) { 171 for (int i = 0; i < children.length; ++i) { 172 ASTNode child = (ASTNode) children[i]; 173 if (child != null) { 174 child = child.treeCopyNoTransform(); 175 tree.setChild(child, i); 176 } 177 } 178 } 179 return tree; 180 } 181 /** 182 * Create a deep copy of the AST subtree at this node. 183 * The subtree of this node is traversed to trigger rewrites before copy. 184 * The copy is dangling, i.e. has no parent. 185 * @return dangling copy of the subtree at this node 186 * @apilevel low-level 187 * @declaredat ASTNode:119 188 */ 189 public WildcardsCompilationUnit treeCopy() { 190 doFullTraversal(); 191 return treeCopyNoTransform(); 192 } 193 /** 194 * @apilevel internal 195 * @declaredat ASTNode:126 196 */ 197 protected boolean is$Equal(ASTNode node) { 198 return super.is$Equal(node) && (tokenString_PackageDecl == ((WildcardsCompilationUnit)node).tokenString_PackageDecl); 199 } 200 /** 201 * Replaces the lexeme PackageDecl. 202 * @param value The new value for the lexeme PackageDecl. 203 * @apilevel high-level 204 */ 205 public void setPackageDecl(String value) { 206 tokenString_PackageDecl = value; 207 } 208 /** 209 * JastAdd-internal setter for lexeme PackageDecl using the Beaver parser. 210 * @param symbol Symbol containing the new value for the lexeme PackageDecl 211 * @apilevel internal 212 */ 213 public void setPackageDecl(beaver.Symbol symbol) { 214 if (symbol.value != null && !(symbol.value instanceof String)) 215 throw new UnsupportedOperationException("setPackageDecl is only valid for String lexemes"); 216 tokenString_PackageDecl = (String)symbol.value; 217 PackageDeclstart = symbol.getStart(); 218 PackageDeclend = symbol.getEnd(); 219 } 220 /** 221 * Retrieves the value for the lexeme PackageDecl. 222 * @return The value for the lexeme PackageDecl. 223 * @apilevel high-level 224 */ 225 @ASTNodeAnnotation.Token(name="PackageDecl") 226 public String getPackageDecl() { 227 return tokenString_PackageDecl != null ? tokenString_PackageDecl : ""; 228 } 229 /** 230 * Replaces the ImportDecl list. 231 * @param list The new list node to be used as the ImportDecl list. 232 * @apilevel high-level 233 */ 234 public void setImportDeclList(List<ImportDecl> list) { 235 setChild(list, 0); 236 } 237 /** 238 * Retrieves the number of children in the ImportDecl list. 239 * @return Number of children in the ImportDecl list. 240 * @apilevel high-level 241 */ 242 public int getNumImportDecl() { 243 return getImportDeclList().getNumChild(); 244 } 245 /** 246 * Retrieves the number of children in the ImportDecl list. 247 * Calling this method will not trigger rewrites. 248 * @return Number of children in the ImportDecl list. 249 * @apilevel low-level 250 */ 251 public int getNumImportDeclNoTransform() { 252 return getImportDeclListNoTransform().getNumChildNoTransform(); 253 } 254 /** 255 * Retrieves the element at index {@code i} in the ImportDecl list. 256 * @param i Index of the element to return. 257 * @return The element at position {@code i} in the ImportDecl list. 258 * @apilevel high-level 259 */ 260 public ImportDecl getImportDecl(int i) { 261 return (ImportDecl) getImportDeclList().getChild(i); 262 } 263 /** 264 * Check whether the ImportDecl list has any children. 265 * @return {@code true} if it has at least one child, {@code false} otherwise. 266 * @apilevel high-level 267 */ 268 public boolean hasImportDecl() { 269 return getImportDeclList().getNumChild() != 0; 270 } 271 /** 272 * Append an element to the ImportDecl list. 273 * @param node The element to append to the ImportDecl list. 274 * @apilevel high-level 275 */ 276 public void addImportDecl(ImportDecl node) { 277 List<ImportDecl> list = (parent == null) ? getImportDeclListNoTransform() : getImportDeclList(); 278 list.addChild(node); 279 } 280 /** 281 * @apilevel low-level 282 */ 283 public void addImportDeclNoTransform(ImportDecl node) { 284 List<ImportDecl> list = getImportDeclListNoTransform(); 285 list.addChild(node); 286 } 287 /** 288 * Replaces the ImportDecl list element at index {@code i} with the new node {@code node}. 289 * @param node The new node to replace the old list element. 290 * @param i The list index of the node to be replaced. 291 * @apilevel high-level 292 */ 293 public void setImportDecl(ImportDecl node, int i) { 294 List<ImportDecl> list = getImportDeclList(); 295 list.setChild(node, i); 296 } 297 /** 298 * Retrieves the ImportDecl list. 299 * @return The node representing the ImportDecl list. 300 * @apilevel high-level 301 */ 302 @ASTNodeAnnotation.ListChild(name="ImportDecl") 303 public List<ImportDecl> getImportDeclList() { 304 List<ImportDecl> list = (List<ImportDecl>) getChild(0); 305 return list; 306 } 307 /** 308 * Retrieves the ImportDecl list. 309 * <p><em>This method does not invoke AST transformations.</em></p> 310 * @return The node representing the ImportDecl list. 311 * @apilevel low-level 312 */ 313 public List<ImportDecl> getImportDeclListNoTransform() { 314 return (List<ImportDecl>) getChildNoTransform(0); 315 } 316 /** 317 * Retrieves the ImportDecl list. 318 * @return The node representing the ImportDecl list. 319 * @apilevel high-level 320 */ 321 public List<ImportDecl> getImportDecls() { 322 return getImportDeclList(); 323 } 324 /** 325 * Retrieves the ImportDecl list. 326 * <p><em>This method does not invoke AST transformations.</em></p> 327 * @return The node representing the ImportDecl list. 328 * @apilevel low-level 329 */ 330 public List<ImportDecl> getImportDeclsNoTransform() { 331 return getImportDeclListNoTransform(); 332 } 333 /** 334 * Replaces the TypeDecl list. 335 * @param list The new list node to be used as the TypeDecl list. 336 * @apilevel high-level 337 */ 338 public void setTypeDeclList(List<TypeDecl> list) { 339 setChild(list, 1); 340 } 341 /** 342 * Retrieves the number of children in the TypeDecl list. 343 * @return Number of children in the TypeDecl list. 344 * @apilevel high-level 345 */ 346 public int getNumTypeDecl() { 347 return getTypeDeclList().getNumChild(); 348 } 349 /** 350 * Retrieves the number of children in the TypeDecl list. 351 * Calling this method will not trigger rewrites. 352 * @return Number of children in the TypeDecl list. 353 * @apilevel low-level 354 */ 355 public int getNumTypeDeclNoTransform() { 356 return getTypeDeclListNoTransform().getNumChildNoTransform(); 357 } 358 /** 359 * Retrieves the element at index {@code i} in the TypeDecl list. 360 * @param i Index of the element to return. 361 * @return The element at position {@code i} in the TypeDecl list. 362 * @apilevel high-level 363 */ 364 public TypeDecl getTypeDecl(int i) { 365 return (TypeDecl) getTypeDeclList().getChild(i); 366 } 367 /** 368 * Check whether the TypeDecl list has any children. 369 * @return {@code true} if it has at least one child, {@code false} otherwise. 370 * @apilevel high-level 371 */ 372 public boolean hasTypeDecl() { 373 return getTypeDeclList().getNumChild() != 0; 374 } 375 /** 376 * Append an element to the TypeDecl list. 377 * @param node The element to append to the TypeDecl list. 378 * @apilevel high-level 379 */ 380 public void addTypeDecl(TypeDecl node) { 381 List<TypeDecl> list = (parent == null) ? getTypeDeclListNoTransform() : getTypeDeclList(); 382 list.addChild(node); 383 } 384 /** 385 * @apilevel low-level 386 */ 387 public void addTypeDeclNoTransform(TypeDecl node) { 388 List<TypeDecl> list = getTypeDeclListNoTransform(); 389 list.addChild(node); 390 } 391 /** 392 * Replaces the TypeDecl list element at index {@code i} with the new node {@code node}. 393 * @param node The new node to replace the old list element. 394 * @param i The list index of the node to be replaced. 395 * @apilevel high-level 396 */ 397 public void setTypeDecl(TypeDecl node, int i) { 398 List<TypeDecl> list = getTypeDeclList(); 399 list.setChild(node, i); 400 } 401 /** 402 * Retrieves the TypeDecl list. 403 * @return The node representing the TypeDecl list. 404 * @apilevel high-level 405 */ 406 @ASTNodeAnnotation.ListChild(name="TypeDecl") 407 public List<TypeDecl> getTypeDeclList() { 408 List<TypeDecl> list = (List<TypeDecl>) getChild(1); 409 return list; 410 } 411 /** 412 * Retrieves the TypeDecl list. 413 * <p><em>This method does not invoke AST transformations.</em></p> 414 * @return The node representing the TypeDecl list. 415 * @apilevel low-level 416 */ 417 public List<TypeDecl> getTypeDeclListNoTransform() { 418 return (List<TypeDecl>) getChildNoTransform(1); 419 } 420 /** 421 * Retrieves the TypeDecl list. 422 * @return The node representing the TypeDecl list. 423 * @apilevel high-level 424 */ 425 public List<TypeDecl> getTypeDecls() { 426 return getTypeDeclList(); 427 } 428 /** 429 * Retrieves the TypeDecl list. 430 * <p><em>This method does not invoke AST transformations.</em></p> 431 * @return The node representing the TypeDecl list. 432 * @apilevel low-level 433 */ 434 public List<TypeDecl> getTypeDeclsNoTransform() { 435 return getTypeDeclListNoTransform(); 436 } 437 /** 438 * @apilevel internal 439 */ 440 protected boolean typeWildcard_computed = false; 441 /** 442 * @apilevel internal 443 */ 444 protected TypeDecl typeWildcard_value; 445 /** 446 * @apilevel internal 447 */ 448 private void typeWildcard_reset() { 449 typeWildcard_computed = false; 450 typeWildcard_value = null; 451 } 452 /** 453 * @attribute syn 454 * @aspect LookupParTypeDecl 455 * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1482 456 */ 457 @ASTNodeAnnotation.Attribute 458 public TypeDecl typeWildcard() { 459 ASTNode$State state = state(); 460 if (typeWildcard_computed) { 461 return typeWildcard_value; 462 } 463 boolean intermediate = state.INTERMEDIATE_VALUE; 464 state.INTERMEDIATE_VALUE = false; 465 int num = state.boundariesCrossed; 466 boolean isFinal = this.is$Final(); 467 typeWildcard_value = new WildcardType( 468 new Modifiers(new List().add(new Modifier("public"))), 469 "?", 470 new List()); 471 typeWildcard_value.setParent(this); 472 typeWildcard_value.is$Final = true; 473 if (true) { 474 typeWildcard_computed = true; 475 } else { 476 } 477 state.INTERMEDIATE_VALUE |= intermediate; 478 479 return typeWildcard_value; 480 } 481 /** 482 * @apilevel internal 483 */ 484 protected List lookupWildcardExtends_TypeDecl_list; 485 /** 486 * @apilevel internal 487 */ 488 protected java.util.Map lookupWildcardExtends_TypeDecl_values; 489 /** 490 * @apilevel internal 491 */ 492 private void lookupWildcardExtends_TypeDecl_reset() { 493 lookupWildcardExtends_TypeDecl_values = null; 494 lookupWildcardExtends_TypeDecl_list = null; 495 } 496 /** 497 * @attribute syn 498 * @aspect LookupParTypeDecl 499 * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1492 500 */ 501 @ASTNodeAnnotation.Attribute 502 public TypeDecl lookupWildcardExtends(TypeDecl bound) { 503 Object _parameters = bound; 504 if (lookupWildcardExtends_TypeDecl_values == null) lookupWildcardExtends_TypeDecl_values = new org.jastadd.util.RobustMap(new java.util.HashMap()); 505 ASTNode$State state = state(); 506 if (lookupWildcardExtends_TypeDecl_values.containsKey(_parameters)) { 507 return (TypeDecl) lookupWildcardExtends_TypeDecl_values.get(_parameters); 508 } 509 boolean intermediate = state.INTERMEDIATE_VALUE; 510 state.INTERMEDIATE_VALUE = false; 511 int num = state.boundariesCrossed; 512 boolean isFinal = this.is$Final(); 513 TypeDecl lookupWildcardExtends_TypeDecl_value = new WildcardExtendsType( 514 new Modifiers(new List().add(new Modifier("public"))), 515 "? extends " + bound.fullName(), 516 new List(), 517 bound.createBoundAccess()); 518 if (lookupWildcardExtends_TypeDecl_list == null) { 519 lookupWildcardExtends_TypeDecl_list = new List(); 520 lookupWildcardExtends_TypeDecl_list.is$Final = true; 521 lookupWildcardExtends_TypeDecl_list.setParent(this); 522 } 523 lookupWildcardExtends_TypeDecl_list.add(lookupWildcardExtends_TypeDecl_value); 524 if (lookupWildcardExtends_TypeDecl_value != null) { 525 lookupWildcardExtends_TypeDecl_value = (TypeDecl) lookupWildcardExtends_TypeDecl_list.getChild(lookupWildcardExtends_TypeDecl_list.numChildren-1); 526 lookupWildcardExtends_TypeDecl_value.is$Final = true; 527 } 528 if (true) { 529 lookupWildcardExtends_TypeDecl_values.put(_parameters, lookupWildcardExtends_TypeDecl_value); 530 } else { 531 } 532 state.INTERMEDIATE_VALUE |= intermediate; 533 534 return lookupWildcardExtends_TypeDecl_value; 535 } 536 /** 537 * @apilevel internal 538 */ 539 protected List lookupWildcardSuper_TypeDecl_list; 540 /** 541 * @apilevel internal 542 */ 543 protected java.util.Map lookupWildcardSuper_TypeDecl_values; 544 /** 545 * @apilevel internal 546 */ 547 private void lookupWildcardSuper_TypeDecl_reset() { 548 lookupWildcardSuper_TypeDecl_values = null; 549 lookupWildcardSuper_TypeDecl_list = null; 550 } 551 /** 552 * @attribute syn 553 * @aspect LookupParTypeDecl 554 * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1506 555 */ 556 @ASTNodeAnnotation.Attribute 557 public TypeDecl lookupWildcardSuper(TypeDecl bound) { 558 Object _parameters = bound; 559 if (lookupWildcardSuper_TypeDecl_values == null) lookupWildcardSuper_TypeDecl_values = new org.jastadd.util.RobustMap(new java.util.HashMap()); 560 ASTNode$State state = state(); 561 if (lookupWildcardSuper_TypeDecl_values.containsKey(_parameters)) { 562 return (TypeDecl) lookupWildcardSuper_TypeDecl_values.get(_parameters); 563 } 564 boolean intermediate = state.INTERMEDIATE_VALUE; 565 state.INTERMEDIATE_VALUE = false; 566 int num = state.boundariesCrossed; 567 boolean isFinal = this.is$Final(); 568 TypeDecl lookupWildcardSuper_TypeDecl_value = new WildcardSuperType( 569 new Modifiers(new List().add(new Modifier("public"))), 570 "? super " + bound.fullName(), 571 new List(), 572 bound.createBoundAccess()); 573 if (lookupWildcardSuper_TypeDecl_list == null) { 574 lookupWildcardSuper_TypeDecl_list = new List(); 575 lookupWildcardSuper_TypeDecl_list.is$Final = true; 576 lookupWildcardSuper_TypeDecl_list.setParent(this); 577 } 578 lookupWildcardSuper_TypeDecl_list.add(lookupWildcardSuper_TypeDecl_value); 579 if (lookupWildcardSuper_TypeDecl_value != null) { 580 lookupWildcardSuper_TypeDecl_value = (TypeDecl) lookupWildcardSuper_TypeDecl_list.getChild(lookupWildcardSuper_TypeDecl_list.numChildren-1); 581 lookupWildcardSuper_TypeDecl_value.is$Final = true; 582 } 583 if (true) { 584 lookupWildcardSuper_TypeDecl_values.put(_parameters, lookupWildcardSuper_TypeDecl_value); 585 } else { 586 } 587 state.INTERMEDIATE_VALUE |= intermediate; 588 589 return lookupWildcardSuper_TypeDecl_value; 590 } 591 /** 592 * @apilevel internal 593 */ 594 protected List lookupLUBType_Collection_list; 595 /** 596 * @apilevel internal 597 */ 598 protected java.util.Map lookupLUBType_Collection_values; 599 /** 600 * @apilevel internal 601 */ 602 private void lookupLUBType_Collection_reset() { 603 lookupLUBType_Collection_values = null; 604 lookupLUBType_Collection_list = null; 605 } 606 /** 607 * @attribute syn 608 * @aspect LookupParTypeDecl 609 * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1520 610 */ 611 @ASTNodeAnnotation.Attribute 612 public LUBType lookupLUBType(Collection bounds) { 613 Object _parameters = bounds; 614 if (lookupLUBType_Collection_values == null) lookupLUBType_Collection_values = new org.jastadd.util.RobustMap(new java.util.HashMap()); 615 ASTNode$State state = state(); 616 if (lookupLUBType_Collection_values.containsKey(_parameters)) { 617 return (LUBType) lookupLUBType_Collection_values.get(_parameters); 618 } 619 boolean intermediate = state.INTERMEDIATE_VALUE; 620 state.INTERMEDIATE_VALUE = false; 621 int num = state.boundariesCrossed; 622 boolean isFinal = this.is$Final(); 623 LUBType lookupLUBType_Collection_value = createLUBType(bounds); 624 if (lookupLUBType_Collection_list == null) { 625 lookupLUBType_Collection_list = new List(); 626 lookupLUBType_Collection_list.is$Final = true; 627 lookupLUBType_Collection_list.setParent(this); 628 } 629 lookupLUBType_Collection_list.add(lookupLUBType_Collection_value); 630 if (lookupLUBType_Collection_value != null) { 631 lookupLUBType_Collection_value = (LUBType) lookupLUBType_Collection_list.getChild(lookupLUBType_Collection_list.numChildren-1); 632 lookupLUBType_Collection_value.is$Final = true; 633 } 634 if (true) { 635 lookupLUBType_Collection_values.put(_parameters, lookupLUBType_Collection_value); 636 } else { 637 } 638 state.INTERMEDIATE_VALUE |= intermediate; 639 640 return lookupLUBType_Collection_value; 641 } 642 /** 643 * @apilevel internal 644 */ 645 protected List lookupGLBType_ArrayList_list; 646 /** 647 * @apilevel internal 648 */ 649 protected java.util.Map lookupGLBType_ArrayList_values; 650 /** 651 * @apilevel internal 652 */ 653 private void lookupGLBType_ArrayList_reset() { 654 lookupGLBType_ArrayList_values = null; 655 lookupGLBType_ArrayList_list = null; 656 } 657 /** 658 * @attribute syn 659 * @aspect LookupParTypeDecl 660 * @declaredat /home/jesper/git/extendj/java5/frontend/Generics.jrag:1563 661 */ 662 @ASTNodeAnnotation.Attribute 663 public GLBType lookupGLBType(ArrayList bounds) { 664 Object _parameters = bounds; 665 if (lookupGLBType_ArrayList_values == null) lookupGLBType_ArrayList_values = new org.jastadd.util.RobustMap(new java.util.HashMap()); 666 ASTNode$State state = state(); 667 if (lookupGLBType_ArrayList_values.containsKey(_parameters)) { 668 return (GLBType) lookupGLBType_ArrayList_values.get(_parameters); 669 } 670 boolean intermediate = state.INTERMEDIATE_VALUE; 671 state.INTERMEDIATE_VALUE = false; 672 int num = state.boundariesCrossed; 673 boolean isFinal = this.is$Final(); 674 GLBType lookupGLBType_ArrayList_value = lookupGLBType_compute(bounds); 675 if (lookupGLBType_ArrayList_list == null) { 676 lookupGLBType_ArrayList_list = new List(); 677 lookupGLBType_ArrayList_list.is$Final = true; 678 lookupGLBType_ArrayList_list.setParent(this); 679 } 680 lookupGLBType_ArrayList_list.add(lookupGLBType_ArrayList_value); 681 if (lookupGLBType_ArrayList_value != null) { 682 lookupGLBType_ArrayList_value = (GLBType) lookupGLBType_ArrayList_list.getChild(lookupGLBType_ArrayList_list.numChildren-1); 683 lookupGLBType_ArrayList_value.is$Final = true; 684 } 685 if (true) { 686 lookupGLBType_ArrayList_values.put(_parameters, lookupGLBType_ArrayList_value); 687 } else { 688 } 689 state.INTERMEDIATE_VALUE |= intermediate; 690 691 return lookupGLBType_ArrayList_value; 692 } 693 /** 694 * @apilevel internal 695 */ 696 private GLBType lookupGLBType_compute(ArrayList bounds) { 697 List boundList = new List(); 698 StringBuilder name = new StringBuilder(); 699 for (Iterator iter = bounds.iterator(); iter.hasNext(); ) { 700 TypeDecl typeDecl = (TypeDecl) iter.next(); 701 boundList.add(typeDecl.createBoundAccess()); 702 name.append("& " + typeDecl.typeName()); 703 } 704 GLBType decl = new GLBType( 705 new Modifiers(new List().add(new Modifier("public"))), 706 name.toString(), 707 new List(), 708 boundList 709 ); 710 return decl; 711 } 712 /** 713 * @apilevel internal 714 */ 715 public ASTNode rewriteTo() { 716 return super.rewriteTo(); 717 } 718 }