|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.util.Utils
at.dms.kjc.CMember
at.dms.kjc.CClass
public abstract class CClass
This class represents the exported members of a class (inner classes, methods and fields)
Field Summary | |
---|---|
protected static CClass |
CLS_UNDEFINED
|
Fields inherited from class at.dms.kjc.CMember |
---|
owner |
Fields inherited from class at.dms.util.Utils |
---|
EMPTY_LIST, getForLoopCallers |
Fields inherited from interface at.dms.kjc.Constants |
---|
CMP_VERSION, JAV_CLASS, JAV_CLONE, JAV_CLONEABLE, JAV_CONSTRUCTOR, JAV_ERROR, JAV_EXCEPTION, JAV_INIT, JAV_LENGTH, JAV_NAME_SEPARATOR, JAV_OBJECT, JAV_OUTER_THIS, JAV_RUNTIME, JAV_RUNTIME_EXCEPTION, JAV_STATIC_INIT, JAV_STRING, JAV_STRINGBUFFER, JAV_THIS, JAV_THROWABLE, OPE_BAND, OPE_BNOT, OPE_BOR, OPE_BSR, OPE_BXOR, OPE_EQ, OPE_GE, OPE_GT, OPE_LE, OPE_LNOT, OPE_LT, OPE_MINUS, OPE_NE, OPE_PERCENT, OPE_PLUS, OPE_POSTDEC, OPE_POSTINC, OPE_PREDEC, OPE_PREINC, OPE_SIMPLE, OPE_SL, OPE_SLASH, OPE_SR, OPE_STAR, TID_ARRAY, TID_BIT, TID_BOOLEAN, TID_BYTE, TID_CHAR, TID_CLASS, TID_DOUBLE, TID_FLOAT, TID_INT, TID_LONG, TID_SHORT, TID_VECTOR, TID_VOID, VECTOR_EMPTY |
Constructor Summary | |
---|---|
protected |
CClass()
|
|
CClass(CClass owner,
String sourceFile,
int modifiers,
String ident,
String qualifiedName,
CClassType superClass,
boolean deprecated)
Constructs a class export from file |
Method Summary | |
---|---|
void |
addField(CSourceField field)
Adds a field. |
void |
close(CClassType[] interfaces,
Hashtable<String,CField> fields,
CMethod[] methods)
Ends the definition of this class |
void |
collectApplicableMethods(Vector container,
String ident,
CType[] actuals)
Adds all applicable methods (JLS 15.12.2.1) to the specified container. |
Object |
deepClone()
Returns a deep clone of this object. |
protected void |
deepCloneInto(CClass other)
Clones all fields of this into |
boolean |
descendsFrom(CClass from)
descendsFrom |
CType[] |
genConstructorArray(CType[] params)
add synthetic parameters to method def |
void |
genOuterSyntheticParams(CodeSequence code)
add synthetic parameters to method call |
void |
genSyntheticParamsFromExplicitSuper(boolean qualifiedAndAnonymous,
CodeSequence code)
add synthetic parameters to super constructor invocation. |
CMethod[] |
getAbstractMethods()
Returns the abstract methods of this class or interface. |
CMethod[] |
getApplicableMethods(String ident,
CType[] actuals)
Returns all applicable methods (JLS 15.12.2.1). |
CClass |
getCClass()
|
CField |
getField(String ident)
Returns the field with the specified name. |
int |
getFieldCount()
Returns the number of fields. |
CField[] |
getFields()
Returns an array containing the fields defined by this class. |
protected static String |
getIdent(String qualifiedName)
|
protected CMethod |
getImplementingMethod(CMethod pattern,
CClass caller,
boolean localClassOnly)
Returns the non-abstract method that implements the specified method, or null if the method is not implemented. |
CClassType[] |
getInnerClasses()
|
CClassType[] |
getInterfaces()
Returns the interfaces defined by this class. |
CMethod[] |
getMethods()
Returns the methods defined by this class. |
String |
getPackage()
|
String |
getQualifiedName()
|
Hashtable<String,CField> |
getRawFields()
getFields will fail if any fields are binary. |
String |
getSourceFile()
Returns the source file of this class. |
CClass |
getSuperClass()
Returns the super class of this class |
CClassType |
getType()
Returns the type of this class |
boolean |
hasOuterThis()
|
boolean |
isAbstract()
|
boolean |
isAccessible(CClass from)
Checks whether this type is accessible from the specified class (JLS 6.6). |
boolean |
isAnonymous()
|
boolean |
isClass()
|
boolean |
isDefinedInside(CClass outer)
Returns true iff this class is defined inside the specified class |
boolean |
isInterface()
|
boolean |
isNested()
Checks whether this type is nested. |
boolean |
isQualifiedAndAnonymous()
|
CClass |
lookupClass(CClass caller,
String name)
This can be used to see if a given class name is visible inside of this file. |
CField |
lookupField(CClass caller,
String ident)
Searches the class or interface to locate declarations of fields that are accessible. |
CMethod |
lookupMethod(CClass caller,
String ident,
CType[] actuals)
JLS 15.12.2 : Searches the class or interface to locate method declarations that are both applicable and accessible, that is, declarations that can be correctly invoked on the given arguments. |
CField |
lookupSuperField(CClass caller,
String ident)
Searches the class or interface to locate declarations of fields that are accessible. |
CMethod[] |
lookupSuperMethod(String ident,
CType[] actuals)
Searches the superclass and superinterfaces to locate method declarations that are applicable. |
void |
setHasOuterThis(boolean hasOuterThis)
Sets hasOuterThis |
void |
setInnerClasses(CClassType[] inners)
End of first pass, we need innerclassesinterfaces |
void |
setQualifiedAndAnonymous(boolean qualifiedAndAnonymous)
|
void |
setSuperClass(CClassType superClass)
Sets the super class of this class |
void |
setType(CType type)
|
String |
toString()
Returns a string representation of this class. |
Methods inherited from class at.dms.kjc.CMember |
---|
deepCloneInto, getField, getIdent, getJavaName, getMethod, getModifiers, getOwner, getPrefixName, isDeprecated, isFinal, isPrivate, isProtected, isPublic, isStatic, setModifiers |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static CClass CLS_UNDEFINED
Constructor Detail |
---|
protected CClass()
public CClass(CClass owner, String sourceFile, int modifiers, String ident, String qualifiedName, CClassType superClass, boolean deprecated)
Method Detail |
---|
public void close(CClassType[] interfaces, Hashtable<String,CField> fields, CMethod[] methods)
public CClass getCClass()
getCClass
in class CMember
public boolean isNested()
public boolean isAbstract()
public boolean isAnonymous()
public boolean hasOuterThis()
public void setHasOuterThis(boolean hasOuterThis)
public boolean isInterface()
public boolean isClass()
public String getQualifiedName()
getQualifiedName
in class CMember
public String getPackage()
public CClass getSuperClass()
public void setSuperClass(CClassType superClass)
public CClassType getType()
public void setType(CType type)
public String getSourceFile()
public CField getField(String ident)
ident
- the name of the fieldpublic int getFieldCount()
public CField[] getFields()
public Hashtable<String,CField> getRawFields()
public CClassType[] getInterfaces()
public CMethod[] getMethods()
public CClassType[] getInnerClasses()
public void setInnerClasses(CClassType[] inners)
public boolean descendsFrom(CClass from)
from
- an other CClass
public boolean isDefinedInside(CClass outer)
outer
- another classpublic String toString()
toString
in class Object
public void setQualifiedAndAnonymous(boolean qualifiedAndAnonymous)
public boolean isQualifiedAndAnonymous()
public CClass lookupClass(CClass caller, String name) throws UnpositionedError
caller
- the class of the callername
- a TypeName (6.5.2)
UnpositionedError
public CField lookupField(CClass caller, String ident) throws UnpositionedError
caller
- the class of the callerident
- the simple name of the field
UnpositionedError
- this error will be positioned soonpublic CField lookupSuperField(CClass caller, String ident) throws UnpositionedError
caller
- the class of the callerident
- the simple name of the field
UnpositionedError
- this error will be positioned soonpublic CMethod lookupMethod(CClass caller, String ident, CType[] actuals) throws UnpositionedError
caller
- the class of the callerident
- method invocation nameactuals
- method invocation arguments
UnpositionedError
- this error will be positioned soonpublic CMethod[] lookupSuperMethod(String ident, CType[] actuals) throws UnpositionedError
ident
- method invocation nameactuals
- method invocation arguments
UnpositionedError
- this error will be positioned soonpublic CMethod[] getAbstractMethods()
protected CMethod getImplementingMethod(CMethod pattern, CClass caller, boolean localClassOnly)
pattern
- the method specificationlocalClassOnly
- do not search superclasses ?public CMethod[] getApplicableMethods(String ident, CType[] actuals)
ident
- method invocation nameactuals
- method invocation argumentspublic void collectApplicableMethods(Vector container, String ident, CType[] actuals)
container
- the container for the methodsident
- method invocation nameactuals
- method invocation argumentsprotected static String getIdent(String qualifiedName)
public boolean isAccessible(CClass from)
isAccessible
in class CMember
public void addField(CSourceField field)
public CType[] genConstructorArray(CType[] params)
public void genOuterSyntheticParams(CodeSequence code)
public void genSyntheticParamsFromExplicitSuper(boolean qualifiedAndAnonymous, CodeSequence code)
qualifiedAndAnonymous
- true, its it is a qualifiedpublic Object deepClone()
deepClone
in interface DeepCloneable
deepClone
in class CMember
protected void deepCloneInto(CClass other)
other
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |