java.lang.Object | |
↳ | sun.tools.java.Type |
Known Direct Subclasses |
This class represents an Java Type.
It encapsulates an Java type signature and it provides quick access to the components of the type. Note that all types are hashed into a hashtable (typeHash), that means that each distinct type is only allocated once, saving space and making equality checks cheap.
For simple types use the constants defined in this class. (Type.tInt, Type.tShort, ...). To create complex types use the static methods Type.tArray, Type.tMethod or Type.tClass. For classes, arrays and method types a sub class of class type is created which defines the extra type components. WARNING: The contents of this source file are not part of any supported API. Code that depends on them does so at its own risk: they are subject to change or removal without notice.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
sun.tools.java.Constants
| |||||||||||
From interface
sun.tools.java.RuntimeConstants
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
noArgs | |||||||||||
tBoolean | |||||||||||
tByte | |||||||||||
tChar | |||||||||||
tClassDesc | |||||||||||
tCloneable | |||||||||||
tDouble | |||||||||||
tError | |||||||||||
tFloat | |||||||||||
tInt | |||||||||||
tLong | |||||||||||
tNull | |||||||||||
tObject | |||||||||||
tPackage | |||||||||||
tSerializable | |||||||||||
tShort | |||||||||||
tString | |||||||||||
tVoid | |||||||||||
typeCode | The TypeCode of this type. | ||||||||||
typeSig | The TypeSignature of this type. |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
sun.tools.java.Constants
| |||||||||||
From interface
sun.tools.java.RuntimeConstants
|
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a type given a typecode and a type signature.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Check if the type arguments are the same.
| |||||||||||
Return the argument types.
| |||||||||||
Return the array dimension.
| |||||||||||
Return the ClassName.
| |||||||||||
Return the element type of an array type.
| |||||||||||
Return the return type.
| |||||||||||
Return the type code.
| |||||||||||
Return the type code offset.
| |||||||||||
Return the type mask.
| |||||||||||
Return the Java type signature.
| |||||||||||
Check for a certain set of types.
| |||||||||||
Check for a certain type.
| |||||||||||
Check to see if this is the bogus type "array of void"
Although this highly degenerate "type" is not constructable from
the grammar, the Parser accepts it.
| |||||||||||
Given an inner identifier, return the non-inner, mangled
representation used to manage signatures.
| |||||||||||
Return the amount of space this type takes up on the
Java operand stack.
| |||||||||||
Create an array type.
| |||||||||||
Create a class type.
| |||||||||||
Create a method type with no arguments.
| |||||||||||
Create a method type with arguments.
| |||||||||||
Create a Type from an Java type signature.
| |||||||||||
Convert to a String
| |||||||||||
Convert a Type to a string, if abbrev is true class names are
not fully qualified, if ret is true the return type is included.
| |||||||||||
Create a type string, given an identifier.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
The TypeCode of this type. The value of this field is one of the TC_* contant values defined in Constants.
The TypeSignature of this type. This type signature is equivalent to the runtime type signatures used by the interpreter.
Check if the type arguments are the same.
Return the array dimension. Only works for array types.
Return the type code.
Return the type code offset. This offset can be added to an opcode to get the right opcode type. Most opcodes are ordered: int, long, float, double, array. For example: iload, lload fload, dload, aload. So the appropriate opcode is iadd + type.getTypeCodeOffset().
Return the type mask. The bits in this mask correspond to the TM_* constants defined in Constants. Only one bit is set at a type.
Check for a certain set of types.
Check for a certain type.
Check to see if this is the bogus type "array of void" Although this highly degenerate "type" is not constructable from the grammar, the Parser accepts it. Rather than monkey with the Parser, we check for the bogus type at specific points and give a nice error.
Given an inner identifier, return the non-inner, mangled representation used to manage signatures. Note: It is changed to 'public' for Jcov file generation. (see Assembler.java)
Return the amount of space this type takes up on the Java operand stack. For a method this is equal to the total space taken up by the arguments.
Create a method type with arguments.
Create a Type from an Java type signature.
CompilerError | invalid type signature. |
---|
Convert a Type to a string, if abbrev is true class names are not fully qualified, if ret is true the return type is included.