|
||||||||||
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.CType
at.dms.kjc.CClassType
at.dms.kjc.CArrayType
public class CArrayType
This class represents class type in the type structure
Field Summary |
---|
Fields inherited from class at.dms.kjc.CClassType |
---|
EMPTY |
Fields inherited from class at.dms.kjc.CType |
---|
instance, type |
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 | |
---|---|
CArrayType(CType baseType,
int arrayBound)
Constructs an array type |
|
CArrayType(CType baseType,
int arrayBound,
JExpression[] dims)
Constructs an array type |
Method Summary | |
---|---|
void |
appendSignature(SimpleStringBuffer buffer)
Appends the VM signature of this type to the specified buffer. |
boolean |
checked()
|
void |
checkType(CContext context)
check that type is valid necessary to resolve String into java/lang/String |
Object |
deepClone()
Returns a deep clone of this object. |
protected void |
deepCloneInto(CArrayType other)
Clones all fields of this into |
boolean |
equals(CType other)
equals |
int |
getArrayBound()
|
CType |
getBaseType()
|
JExpression[] |
getDims()
Get dimensions of array. |
CType |
getElementType()
Returns the type of the elements of an array of this type. |
String |
getQualifiedName()
|
int |
getSize()
Returns the stack size used by a value of this type. |
int |
getSizeInC()
Returns the stack size (conservative estimate of maximum number of bytes needed in C on 32-bit machine) used by a value of this type. |
int |
getTotalNumElements()
Returns the total number of elements in this array. |
boolean |
isArrayType()
|
boolean |
isAssignableTo(CType dest)
Can this type be converted to the specified type by assignment conversion (JLS 5.2) ? |
boolean |
isCastableTo(CType dest)
Can this type be converted to the specified type by casting conversion (JLS 5.5) ? |
boolean |
isReference()
Checks if a type is a reference type |
void |
setDims(JExpression[] d)
Set array dimensions. |
String |
toString()
Transforms this type to a string |
Methods inherited from class at.dms.kjc.CClassType |
---|
deepCloneInto, getCClass, getIdent, init, isChecked, isCheckedException, isClassType, lookup, setClass |
Methods inherited from class at.dms.kjc.CType |
---|
deepCloneInto, genMethodSignature, getArrayLoadOpcode, getArrayStoreOpcode, getLoadOpcode, getReturnOpcode, getSignature, getStoreOpcode, getTypeID, isFloatingPoint, isNumeric, isOrdinal, isPrimitive, parseMethodSignature, parseSignature |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CArrayType(CType baseType, int arrayBound)
baseType
- the base type of the array typearrayBound
- the dimension of the array typepublic CArrayType(CType baseType, int arrayBound, JExpression[] dims)
baseType
- the base type of the array typearrayBound
- the dimension of the array typedims
- expressions for array bounds in each dimensionMethod Detail |
---|
public String toString()
toString
in class CClassType
public String getQualifiedName()
getQualifiedName
in class CClassType
public void appendSignature(SimpleStringBuffer buffer)
appendSignature
in class CClassType
public int getSize()
CClassType
getSize
in class CClassType
public int getTotalNumElements()
public int getSizeInC()
getSizeInC
in class CClassType
public boolean isReference()
isReference
in class CClassType
public boolean isArrayType()
isArrayType
in class CType
public CType getBaseType()
public CType getElementType()
getBaseType()
.
public int getArrayBound()
public boolean checked()
checked
in class CType
public boolean equals(CType other)
equals
in class CClassType
public void checkType(CContext context) throws UnpositionedError
checkType
in class CClassType
context
- the context (may be be null)
UnpositionedError
- this error will be positioned soonpublic boolean isAssignableTo(CType dest)
isAssignableTo
in class CClassType
dest
- the destination type
public boolean isCastableTo(CType dest)
isCastableTo
in class CClassType
dest
- the destination type
public JExpression[] getDims()
public void setDims(JExpression[] d)
d
- array of JExpressions indicating dimentsions of array.public Object deepClone()
deepClone
in interface DeepCloneable
deepClone
in class CClassType
protected void deepCloneInto(CArrayType other)
other
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |