All Packages Class Hierarchy This Package Previous Next Index
Class de.fub.bytecode.generic.Type
java.lang.Object
|
+----de.fub.bytecode.generic.Type
- public abstract class Type
- extends Object
- implements Constants
Abstract super class for all possible java types, namely basic types
such as int, object types like String and array types, e.g. int[]
- Version:
- $Id: Type.java,v 1.10 1999/06/23 14:57:09 dahm Exp $
- Author:
- M. Dahm
-
BOOLEAN
-
-
BYTE
-
-
CHAR
-
-
DOUBLE
-
-
FLOAT
-
-
INT
-
-
LONG
-
-
NO_ARGS
-
-
NULL
-
-
OBJECT
-
-
SHORT
-
-
signature
-
-
STRING
-
-
STRINGBUFFER
-
-
type
-
-
VOID
- Predefined constants
-
Type(byte, String)
-
-
getArgumentTypes(String)
- Convert arguments of a method (signature) to an array of Type objects.
-
getMethodSignature(Type, Type[])
- Convert type to Java method signature, e.g.
-
getReturnType(String)
- Convert arguments of a method (signature) to a Type object.
-
getSignature()
-
-
getSize()
-
-
getType()
-
-
getType(String)
- Convert signature to a Type object.
-
toString()
-
type
protected byte type
signature
protected String signature
VOID
public static final BasicType VOID
- Predefined constants
BOOLEAN
public static final BasicType BOOLEAN
INT
public static final BasicType INT
SHORT
public static final BasicType SHORT
BYTE
public static final BasicType BYTE
LONG
public static final BasicType LONG
DOUBLE
public static final BasicType DOUBLE
FLOAT
public static final BasicType FLOAT
CHAR
public static final BasicType CHAR
OBJECT
public static final ObjectType OBJECT
STRING
public static final ObjectType STRING
STRINGBUFFER
public static final ObjectType STRINGBUFFER
NO_ARGS
public static final Type NO_ARGS[]
NULL
public static final ReferenceType NULL
Type
protected Type(byte t,
String s)
getSignature
public String getSignature()
- Returns:
- signature for given type.
getType
public byte getType()
- Returns:
- type as defined in Constants
getSize
public int getSize()
- Returns:
- stack size of this type (2 for long and double, 0 for void, 1 otherwise)
toString
public String toString()
- Returns:
- Type string, e.g. `int[]'
- Overrides:
- toString in class Object
getMethodSignature
public static String getMethodSignature(Type return_type,
Type arg_types[])
- Convert type to Java method signature, e.g. int[] f(java.lang.String x)
becomes (Ljava/lang/String;)[I
- Parameters:
- return_type - what the method returns
- arg_types - what are the argument types
- Returns:
- method signature for given type(s).
getType
public static final Type getType(String signature) throws StringIndexOutOfBoundsException
- Convert signature to a Type object.
- Parameters:
- signature - signature string such as Ljava/lang/String;
- Returns:
- type object
getReturnType
public static Type getReturnType(String signature)
- Convert arguments of a method (signature) to a Type object.
- Parameters:
- signature - signature string such as (Ljava/lang/String;)V
- Returns:
- return type
getArgumentTypes
public static Type[] getArgumentTypes(String signature)
- Convert arguments of a method (signature) to an array of Type objects.
- Parameters:
- signature - signature string such as (Ljava/lang/String;)V
- Returns:
- array of argument types
All Packages Class Hierarchy This Package Previous Next Index