JTypeDecl.java |
1 // Copyright 2012- Bill Campbell, Swami Iyer and Bahar Akbal-Delibas 2 3 package jminusminus; 4 5 import java.util.ArrayList; 6 7 /** 8 * An interface supported by class (or later, interface) declarations. 9 */ 10 interface JTypeDecl { 11 /** 12 * Declares this type in the parent context. Called before pre-analysis so that it is 13 * available in the preAnalyze() method of other types. 14 * 15 * @param context the parent (compilation unit) context. 16 */ 17 public void declareThisType(Context context); 18 19 /** 20 * Pre-analyzes the members of this declaration in the parent context. 21 * 22 * @param context the parent (compilation unit) context. 23 */ 24 public void preAnalyze(Context context); 25 26 /** 27 * Returns the name of this type declaration. 28 * 29 * @return the name of this type declaration. 30 */ 31 public String name(); 32 33 /** 34 * Returns the type that this type declaration defines. 35 * 36 * @return the type defined by this type declaration. 37 */ 38 public Type thisType(); 39 40 /** 41 * Returns the type of the extended class for a class or java.lang.Object for an interface. 42 * 43 * @return the type of the extended class for a class or java.lang.Object for an interface. 44 */ 45 public Type superType(); 46 47 /** 48 * Returns the types of the implemented interfaces for a class or extended interfaces for an 49 * interface. 50 * 51 * @return the types of the implemented interfaces for a class or extended interfaces for an 52 * interface. 53 */ 54 public ArrayList<TypeName> superInterfaces(); 55 } 56