|
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.CValueType
This class represents a value specializer "type." It is the base class for a hierarchy representing different kinds of value specializers, e.g. String literals, integer constants, etc.
| Nested Class Summary |
| Nested classes inherited from class org.multijava.mjc.CType |
CType.MethodSignature, CType.MethodSignatureParser, CType.StringBuffers, CType.TupleCollection |
| Field Summary | |
protected JExpression |
dispatchExpr
|
protected JExpression |
dispatchValue
|
protected CType |
staticType
|
| 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 | |
CValueType(CType staticType,
JExpression dispatchExpr)
Constructor |
|
| Method Summary | |
void |
appendSignature(FastStringBuffer buff)
Transforms this type to a string for bytecode attributes |
CType |
checkType(CContextType context)
Register this type as visible, so it can be checked during ITC on the compilation unit |
boolean |
equals(Object o)
Compares two objects for equality. |
int |
getSize()
Returns the size used in stack by value of this type |
JExpression |
getValue()
|
int |
hashCode()
|
protected abstract int |
intValue()
Returns an integer representation of the specializer's value, for use in computing its hashCode. |
boolean |
isAlwaysAssignableTo(CType dest)
Is this type assignable to the given type. |
boolean |
isBoolean()
Check if a type is the boolean type |
boolean |
isCastableTo(CType dest)
Can this type be converted to the specified type by casting conversion (JLS 5.5) ? |
boolean |
isCodedAsInt()
|
boolean |
isFloatingPoint()
Check if a type is an integer type |
boolean |
isNumeric()
Check if a type is a numeric type |
boolean |
isOrdinal()
Check if a type is an integer type |
boolean |
isPrimitive()
Check if a type is a class type |
boolean |
isReference()
Check if a type is a class type |
protected boolean |
isResolvedAndValid()
|
protected abstract boolean |
isValid()
|
boolean |
isValueType()
|
void |
resolveValueType(CExpressionContextType context)
Compute the value of a specializer expression used to dispatch on a compile-time constant. |
String |
signatureStringValue()
Transforms this type's value to a string for use in bytecode attributes for this value specializer. |
String |
specializerSymbol()
Returns the specializer symbol to use when this type is the specializer. |
String |
toString()
Transforms this type to a string |
protected abstract boolean |
valueEquals(CValueType t)
Is the value of this specializer equal to the value of the given value specializer? |
| 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, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected JExpression dispatchExpr
protected JExpression dispatchValue
protected CType staticType
| Constructor Detail |
public CValueType(CType staticType,
JExpression dispatchExpr)
staticType - the associated static type of the formaldispatchExpr - the AST of the specializer expression| Method Detail |
public boolean equals(Object o)
CType
equals in class CTypepublic int hashCode()
hashCode in class Objectpublic boolean isAlwaysAssignableTo(CType dest)
dest - the destination type
JExpression.isAssignableTo(CType)public String toString()
toString in class CTypepublic String signatureStringValue()
public 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 CTypepublic boolean isBoolean()
isBoolean in class CTypepublic boolean isPrimitive()
isPrimitive in class CTypepublic boolean isReference()
isReference in class CTypepublic boolean isValueType()
isValueType in class CTypepublic String specializerSymbol()
specializerSymbol in class CTypepublic JExpression getValue()
getValue in class CTypeprotected abstract boolean valueEquals(CValueType t)
t - the type to compare against
protected abstract int intValue()
protected boolean isResolvedAndValid()
protected abstract boolean isValid()
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 isCastableTo(CType dest)
dest - the destination type
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||