|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.Utils
org.multijava.mjc.CType
org.multijava.mjc.CClassType
org.multijava.mjc.CArrayType
This class represents the array type in the type structure.
CType| Nested Class Summary |
| Nested classes inherited from class org.multijava.mjc.CType |
CType.MethodSignature, CType.MethodSignatureParser, CType.StringBuffers, CType.TupleCollection |
| Field Summary | |
private int |
arrayBound
|
private CType |
baseType
|
private CClassType |
result_type
The result type with the correct universe modifier. |
| Fields inherited from class org.multijava.mjc.CClassType |
arguments, EMPTY, EMPTY_ARG, index, universe |
| Fields inherited from class org.multijava.mjc.CType |
instance, isMethodTypeVariable, isTypeVariable, type |
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Constructor Summary | |
CArrayType(CType baseType,
int arrayBound,
CUniverse array_univ)
Constructs an array type with universe modifier for the whole array. |
|
| Method Summary | |
void |
appendGenericSignature(FastStringBuffer buff)
|
void |
appendSignature(FastStringBuffer buff)
Transforms this type to a string |
boolean |
checked()
|
CType |
checkType(CContextType context)
Checks that this type is valid, throwing an exception if it is not. |
Collection |
directlyVisibleTypes()
Returns the set of types (excluding non-reference types) that are directly visible from this type. |
boolean |
equals(Object other)
Compares two objects for equality. |
boolean |
equals(Object other,
boolean enableUniv)
Compares two objects for equality. |
boolean |
equals(CType other,
CClassType[] substitution)
|
boolean |
equals(CType other,
CClassType[] substitution,
boolean enableUniv)
|
int |
getArrayBound()
|
CType |
getBaseType()
Determine and return the base type of the array. |
CClass |
getCClass()
Returns the class object associated with this type. |
String |
getCUniverseJMLString()
Return the universe modifier as string, for output in JML specifications. |
String |
getCUniverseString()
Return the universe modifiers as string. |
CType |
getDeclaredBaseType()
Return the declared base type of the array. |
CType |
getErasure(CContextType context)
|
CType |
getIndexedType()
|
int |
getSize()
Returns the size used in stack by value of this type |
byte |
getUniverseByteConstant()
Return the Universe bytecode constant of this class type. |
int |
hashCode()
Calculates the hash code for this |
boolean |
implicitlyCastTo(CType dest)
implicitlyCastTo |
boolean |
isAlwaysAssignableTo(CType dest)
Is this type assignable to the given type by assignment type conversion [JLS2 5.2] [JLS2 5.1.4] |
boolean |
isAlwaysAssignableTo(CType dest,
boolean inst)
Is this type assignable to the given type by assignment type conversion [JLS2 5.2] [JLS2 5.1.4] |
boolean |
isAlwaysAssignableTo(CType dest,
CClassType[] subst)
|
boolean |
isAlwaysAssignableToNoUniverses(CType dest,
CClassType[] substitution)
A version of the Assignable check without considering the Universe types. |
boolean |
isArrayType()
|
boolean |
isCastableTo(CType dest)
Can this type be converted to the specified type by casting conversion (JLS 5.5) ? |
boolean |
isConcrete()
Indicates whether this type is concrete. |
boolean |
isReference()
Checks if a type is a reference type |
String |
qualifiedName()
|
String |
toString()
Transforms this type to a string |
| Methods inherited from class org.multijava.mjc.CClassType |
clone, createSubstitutedType, getAllArguments, getArguments, getCUniverse, getIndex, getVisibleTypesFrom, ident, isAlwaysAssignableTo, isAssignableTo, isChecked, isCheckedException, isClassType, isInterface, isLocalTo, isNestedType, originalQualifiedName, plantDispatchTest, printArgs, resolveValueType, setAllArguments, setClass, setCUniverse, setIndex, toVerboseString |
| Methods inherited from class org.multijava.util.Utils |
assertTrue, assertTrue, combineArrays, escapeString, escapeString, fail, fail, getFilePath, hasFlag, hasOtherFlags, parsePathParts, relativePathTo, splitQualifiedName, splitQualifiedName, stripJavaModifiers, stripNonJavaModifiers, stripPrivateModifier, unescapeString, vectorToArray, vectorToIntArray |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
private CType baseType
private int arrayBound
private CClassType result_type
| Constructor Detail |
public CArrayType(CType baseType,
int arrayBound,
CUniverse array_univ)
baseType - the base type of the array typearrayBound - the dimension of the array typearray_univ - the universe for the whole array| Method Detail |
public String toString()
toString in class CClassTypepublic String getCUniverseString()
getCUniverseString in class CClassTypepublic String getCUniverseJMLString()
getCUniverseJMLString in class CClassTypepublic String qualifiedName()
qualifiedName in class CClassTypepublic void appendSignature(FastStringBuffer buff)
appendSignature in interface CTypeSignatureAppenderappendSignature in class CClassTypepublic void appendGenericSignature(FastStringBuffer buff)
appendGenericSignature in interface CTypeSignatureAppenderappendGenericSignature in class CTypepublic int getSize()
CClassType
getSize in class CClassTypepublic boolean isReference()
isReference in class CClassTypepublic boolean isArrayType()
isArrayType in class CTypepublic CType getBaseType()
public CType getIndexedType()
public CType getDeclaredBaseType()
public byte getUniverseByteConstant()
getUniverseByteConstant in class CClassTypepublic int getArrayBound()
public boolean checked()
checked in class CTypepublic boolean equals(Object other)
equals in class CClassTypeother - the object to compare with
other is a CType object
representing the same Java type as this represents
WMD: also compare the universe modifiers.
public boolean equals(Object other,
boolean enableUniv)
CClassType
equals in class CClassType
public boolean equals(CType other,
CClassType[] substitution)
equals in class CClassType
public boolean equals(CType other,
CClassType[] substitution,
boolean enableUniv)
equals in class CClassTypepublic int hashCode()
hashCode in class CClassTypepublic Collection directlyVisibleTypes()
directlyVisibleTypes in class CClassTypepublic boolean isConcrete()
isConcrete in class CClassTypepublic CClass getCClass()
also requires isChecked();
getCClass in class CClassType
public CType checkType(CContextType context)
throws UnpositionedError
checkType in class CClassTypecontext - the context in which this type was
declared, may be null
UnpositionedError - this unpositioned error
should be positioned
by the calling node of
the AST, typically by
calling the
addPosition method of
UnpositionedError
public CType getErasure(CContextType context)
throws UnpositionedError
getErasure in class CClassTypeUnpositionedError
public boolean isAlwaysAssignableTo(CType dest,
boolean inst)
CClassType
isAlwaysAssignableTo in class CClassType
public boolean isAlwaysAssignableTo(CType dest,
CClassType[] subst)
isAlwaysAssignableTo in class CClassTypepublic boolean isAlwaysAssignableTo(CType dest)
isAlwaysAssignableTo in class CClassTypedest - the destination type
public boolean isAlwaysAssignableToNoUniverses(CType dest,
CClassType[] substitution)
isAlwaysAssignableToNoUniverses in class CClassTypepublic boolean isCastableTo(CType dest)
isCastableTo in class CClassTypedest - the destination type
public boolean implicitlyCastTo(CType dest)
implicitlyCastTo in class CClassTypedest - the expression type to cast to
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||