|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.mjc.CParseClassContext
This class is used by the parser to collect the members of a class declaration. 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 store on a stack for reuse.
| Field Summary | |
private ArrayList |
fieldsAndInits
|
private ArrayList |
inners
|
private ArrayList |
methods
|
private static Stack |
stack
|
| Constructor Summary | |
protected |
CParseClassContext()
Hides the default constructor except to subclasses. |
| Method Summary | |
void |
addBlockInitializer(JClassBlock block)
|
void |
addFieldDeclaration(JFieldDeclarationType decl)
|
void |
addInnerDeclaration(JTypeDeclarationType decl)
|
void |
addMethodDeclaration(JMethodDeclarationType decl)
|
protected void |
clear()
Prepares this instance for recycling by clearing all the data stored in its ArrayLists. |
JPhylum[] |
getFieldsAndInits()
|
ArrayList |
getInnerClasses()
|
static CParseClassContext |
getInstance()
Factory method returns an instance of CParseClassContext. |
ArrayList |
getMethods()
|
void |
release()
Calls the static method release(this) |
static void |
release(CParseClassContext context)
Erases the data stored in context and pushes the
instance onto a stack for recycling. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private ArrayList methods
private ArrayList inners
private ArrayList fieldsAndInits
private static Stack stack
| Constructor Detail |
protected CParseClassContext()
| Method Detail |
public static CParseClassContext getInstance()
public void release()
release(this)
public static void release(CParseClassContext context)
context and pushes the
instance onto a stack for recycling.
context - a used instance to be recycledprotected void clear()
public void addFieldDeclaration(JFieldDeclarationType decl)
public void addMethodDeclaration(JMethodDeclarationType decl)
public void addInnerDeclaration(JTypeDeclarationType decl)
public void addBlockInitializer(JClassBlock block)
public ArrayList getMethods()
public ArrayList getInnerClasses()
public JPhylum[] getFieldsAndInits()
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||