|
mjc | ||||||||||
| 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.CNumericType
This class represents java and kopi numericals types Such as byte, short, int, long, float, double
CType| Nested Class Summary |
| Nested classes inherited from class org.multijava.mjc.CType |
CType.MethodSignature, CType.MethodSignatureParser, CType.StringBuffers, CType.TupleCollection |
| Field Summary |
| Fields inherited from class org.multijava.mjc.CType |
EMPTY, instance, isMethodTypeVariable, isTypeVariable, type |
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Constructor Summary | |
protected |
CNumericType(int typeID)
Constructor |
| Method Summary | |
void |
appendSignature(FastStringBuffer buff)
Transforms this type to a string |
CType |
binaryPromote(CType other)
binaryPromote search the type corresponding to the promotion of the two types (this and other) |
CType |
checkType(CContextType context)
Checks that this type is valid, throwing an exception if it is not. |
void |
genCastTo(CNumericType dest,
CodeSequence code)
Generates a sequence of bytecodes |
String |
getSignature()
Transforms this type to a string |
int |
getSize()
Returns the size used in stack by value of this type |
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.2]. |
boolean |
isCastableTo(CType dest)
isCastableTo |
boolean |
isCodedAsInt()
Check if this type is ... |
boolean |
isFloatingPoint()
Check if this type is a floating point type. |
boolean |
isNumeric()
Check if a type is a numeric type |
boolean |
isOrdinal()
Check if this type is an integral type. |
protected boolean |
isValidNumericTypeID(int typeID)
|
void |
resolveValueType(CExpressionContextType context)
Compute the value of a specializer expression used to dispatch on a compile-time constant. |
String |
toString()
Transforms this type to a string |
CType |
unaryPromote()
unaryPromote search the type corresponding to the type after computation |
static CType |
unifyNumeric(CType t1,
CType t2)
This isn't used and isn't right at any rate. |
private static CType |
unifyNumericIn(CType t1,
CType t2)
unifyNumeric search the type corresponding to the unification of the two types |
boolean |
widening_primitive_conv_from(CType from)
Returns true iff from type can be converted by widening
primitive conversion to this type. |
| 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 |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
protected CNumericType(int typeID)
typeID - the ident (int value) of this type| Method Detail |
protected boolean isValidNumericTypeID(int typeID)
public String toString()
toString in class CTypepublic String getSignature()
getSignature in class CTypepublic void appendSignature(FastStringBuffer buff)
public int getSize()
public boolean isNumeric()
isNumeric in class CTypepublic boolean isCodedAsInt()
isCodedAsInt in class CTypepublic boolean isOrdinal()
isOrdinal in class CTypepublic boolean isFloatingPoint()
isFloatingPoint in class CType
public CType checkType(CContextType context)
throws UnpositionedError
context - 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 void resolveValueType(CExpressionContextType context)
throws PositionedError
context - the context in which this class
declaration appears
PositionedError - if the check fails public boolean widening_primitive_conv_from(CType from)
from type can be converted by widening
primitive conversion to this type. [JLS2 5.1.2]
public boolean isAlwaysAssignableTo(CType dest)
dest - the destination type
JExpression.isAssignableTo(CType)public boolean isCastableTo(CType dest)
dest - the destination type
public boolean implicitlyCastTo(CType dest)
implicitlyCastTo in class CTypedest - the expression type to cast to
public static CType unifyNumeric(CType t1,
CType t2)
t1 - the first typet2 - the second type
private static CType unifyNumericIn(CType t1,
CType t2)
t1 - the first typet2 - the second type
public CType unaryPromote()
public CType binaryPromote(CType other)
other - the second type
public void genCastTo(CNumericType dest,
CodeSequence code)
dest - the destination typecode - the code list
|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||