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

Variable Index

 o BOOLEAN
 o BYTE
 o CHAR
 o DOUBLE
 o FLOAT
 o INT
 o LONG
 o NO_ARGS
 o NULL
 o OBJECT
 o SHORT
 o signature
 o STRING
 o STRINGBUFFER
 o type
 o VOID
Predefined constants

Constructor Index

 o Type(byte, String)

Method Index

 o getArgumentTypes(String)
Convert arguments of a method (signature) to an array of Type objects.
 o getMethodSignature(Type, Type[])
Convert type to Java method signature, e.g.
 o getReturnType(String)
Convert arguments of a method (signature) to a Type object.
 o getSignature()
 o getSize()
 o getType()
 o getType(String)
Convert signature to a Type object.
 o toString()

Variables

 o type
 protected byte type
 o signature
 protected String signature
 o VOID
 public static final BasicType VOID
Predefined constants

 o BOOLEAN
 public static final BasicType BOOLEAN
 o INT
 public static final BasicType INT
 o SHORT
 public static final BasicType SHORT
 o BYTE
 public static final BasicType BYTE
 o LONG
 public static final BasicType LONG
 o DOUBLE
 public static final BasicType DOUBLE
 o FLOAT
 public static final BasicType FLOAT
 o CHAR
 public static final BasicType CHAR
 o OBJECT
 public static final ObjectType OBJECT
 o STRING
 public static final ObjectType STRING
 o STRINGBUFFER
 public static final ObjectType STRINGBUFFER
 o NO_ARGS
 public static final Type NO_ARGS[]
 o NULL
 public static final ReferenceType NULL

Constructors

 o Type
 protected Type(byte t,
                String s)

Methods

 o getSignature
 public String getSignature()
Returns:
signature for given type.
 o getType
 public byte getType()
Returns:
type as defined in Constants
 o getSize
 public int getSize()
Returns:
stack size of this type (2 for long and double, 0 for void, 1 otherwise)
 o toString
 public String toString()
Returns:
Type string, e.g. `int[]'
Overrides:
toString in class Object
 o 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).
 o 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
 o 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
 o 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