|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.mjc.CParseCompilationUnitContext
This class is used by the parser to collect the contents of a compilation unit. For efficiency (and to avoid memory leaks caused by poor garbage collection in the JVM) a factory method is used to generate instances and old instances are stored on a stack for reuse.
| Field Summary | |
private CCompilationUnit |
export
|
static JPackageImportType |
JAVA_LANG
|
private JPackageName |
pack
|
private ArrayList |
packageImports
|
private String |
packageName
The name of the package of the compilation unit represented by this. |
private ArrayList |
singleImports
|
private static Stack |
stack
|
private ArrayList |
tlMethods
|
private ArrayList |
typeDeclarations
|
| Constructor Summary | |
private |
CParseCompilationUnitContext()
Hides the default constructor and ensures that every instance package java.lang. |
| Method Summary | |
void |
addMJTopLevelMethodDeclaration(Main compiler,
MJTopLevelMethodDeclaration decl)
|
void |
addPackageImport(JPackageImportType pack)
|
void |
addSingleImport(JClassOrGFImportType clazz)
|
void |
addTypeDeclaration(Main compiler,
JTypeDeclarationType decl)
|
private void |
clear()
prepares this instance for recycling by clearing all the data stored in its ArrayLists. |
CCompilationUnit |
compilationUnitExport()
|
static CParseCompilationUnitContext |
getInstance()
|
ArrayList |
getMJTopLevelMethodDeclarations()
Returns a list of the top level declarations in this compilation unit context. |
JPackageImportType[] |
getPackageImports()
|
JPackageName |
getPackageName()
|
ArrayList |
getSingleImports()
Returns a list representing all the classes and generic functions imported explicitly in this compilation unit. |
JTypeDeclarationType[] |
getTypeDeclarations()
|
void |
release()
Calls the static method release(this) |
static void |
release(CParseCompilationUnitContext context)
Erases the data stored in context and pushes the
instance onto a stack for recycling. |
void |
setPackage(JPackageName pack)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final JPackageImportType JAVA_LANG
private JPackageName pack
private String packageName
private CCompilationUnit export
private ArrayList packageImports
private ArrayList singleImports
private ArrayList typeDeclarations
private ArrayList tlMethods
private static Stack stack
| Constructor Detail |
private CParseCompilationUnitContext()
java.lang.
| Method Detail |
public static CParseCompilationUnitContext getInstance()
public void release()
release(this)
public static void release(CParseCompilationUnitContext context)
context and pushes the
instance onto a stack for recycling.
context - a used instance to be recycledprivate void clear()
public void setPackage(JPackageName pack)
public void addPackageImport(JPackageImportType pack)
public void addSingleImport(JClassOrGFImportType clazz)
public void addTypeDeclaration(Main compiler,
JTypeDeclarationType decl)
public void addMJTopLevelMethodDeclaration(Main compiler,
MJTopLevelMethodDeclaration decl)
public JPackageImportType[] getPackageImports()
public ArrayList getSingleImports()
public JTypeDeclarationType[] getTypeDeclarations()
public ArrayList getMJTopLevelMethodDeclarations()
public JPackageName getPackageName()
public CCompilationUnit compilationUnitExport()
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||