org.apache.bcel.generic

Class ArrayType

public final class ArrayType extends ReferenceType

Denotes array type, such as int[][]

Version: $Id: ArrayType.java 152690 2001-10-29 19:59:54Z jvanzyl $

Author: M. Dahm

Constructor Summary
ArrayType(byte type, int dimensions)
Convenience constructor for array type, e.g. int[]
ArrayType(String class_name, int dimensions)
Convenience constructor for reference array type, e.g.
ArrayType(Type type, int dimensions)
Constructor for array of given type
Method Summary
booleanequals(Object type)
TypegetBasicType()
intgetDimensions()
TypegetElementType()
inthashcode()

Constructor Detail

ArrayType

public ArrayType(byte type, int dimensions)
Convenience constructor for array type, e.g. int[]

Parameters: type array type, e.g. T_INT

ArrayType

public ArrayType(String class_name, int dimensions)
Convenience constructor for reference array type, e.g. Object[]

Parameters: class_name complete name of class (java.lang.String, e.g.)

ArrayType

public ArrayType(Type type, int dimensions)
Constructor for array of given type

Parameters: type type of array (may be an array itself)

Method Detail

equals

public boolean equals(Object type)

Returns: true if both type objects refer to the same array type.

getBasicType

public Type getBasicType()

Returns: basic type of array, i.e., for int[][][] the basic type is int

getDimensions

public int getDimensions()

Returns: number of dimensions of array

getElementType

public Type getElementType()

Returns: element type of array, i.e., for int[][][] the element type is int[][]

hashcode

public int hashcode()

Returns: a hash code value for the object.