src/share/classes/com/sun/tools/javac/code/Symbol.java

changeset 1541
4cc73ec94686
parent 1521
71f35e4b93a5
child 1564
aeadaf905d78
equal deleted inserted replaced
1540:55cca2f38ee6 1541:4cc73ec94686
494 l.append(t.tsym); 494 l.append(t.tsym);
495 } 495 }
496 return l.toList(); 496 return l.toList();
497 } 497 }
498 498
499 public static class DelegatedSymbol extends Symbol { 499 public static class DelegatedSymbol<T extends Symbol> extends Symbol {
500 protected Symbol other; 500 protected T other;
501 public DelegatedSymbol(Symbol other) { 501 public DelegatedSymbol(T other) {
502 super(other.kind, other.flags_field, other.name, other.type, other.owner); 502 super(other.kind, other.flags_field, other.name, other.type, other.owner);
503 this.other = other; 503 this.other = other;
504 } 504 }
505 public String toString() { return other.toString(); } 505 public String toString() { return other.toString(); }
506 public Symbol location() { return other.location(); } 506 public Symbol location() { return other.location(); }
529 return other.accept(v, p); 529 return other.accept(v, p);
530 } 530 }
531 531
532 public <R, P> R accept(Symbol.Visitor<R, P> v, P p) { 532 public <R, P> R accept(Symbol.Visitor<R, P> v, P p) {
533 return v.visitSymbol(other, p); 533 return v.visitSymbol(other, p);
534 }
535
536 public T getUnderlyingSymbol() {
537 return other;
534 } 538 }
535 } 539 }
536 540
537 /** A class for type symbols. Type variables are represented by instances 541 /** A class for type symbols. Type variables are represented by instances
538 * of this class, classes and packages by instances of subclasses. 542 * of this class, classes and packages by instances of subclasses.

mercurial