Package org.apache.bcel.generic
Class ArrayType
- java.lang.Object
-
- org.apache.bcel.generic.Type
-
- org.apache.bcel.generic.ReferenceType
-
- org.apache.bcel.generic.ArrayType
-
public final class ArrayType extends ReferenceType
Denotes array type, such as int[][]
-
-
Field Summary
Fields Modifier and Type Field Description private TypebasicTypeprivate intdimensions
-
Constructor Summary
Constructors Constructor Description ArrayType(byte type, int dimensions)Convenience constructor for array type, for example int[]ArrayType(java.lang.String className, int dimensions)Convenience constructor for reference array type, for example Object[]ArrayType(Type type, int dimensions)Constructor for array of given type
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object type)TypegetBasicType()Gets the basic type of array, that is, for int[][][] the basic type is int.java.lang.StringgetClassName()Gets the name of referenced class.intgetDimensions()Gets the number of dimensions of array.TypegetElementType()Gets the element type of array, that is, for int[][][] the element type is int[][].inthashCode()Gets the hash code of this Type.-
Methods inherited from class org.apache.bcel.generic.ReferenceType
firstCommonSuperclass, getFirstCommonSuperclass, isAssignmentCompatibleWith, isCastableTo
-
Methods inherited from class org.apache.bcel.generic.Type
consumed, encode, getArgumentTypes, getArgumentTypesSize, getMethodSignature, getReturnType, getReturnTypeSize, getSignature, getSignature, getSize, getType, getType, getType, getTypes, getTypeSize, internalTypeNameToSignature, normalizeForStackOrLocal, size, toString
-
-
-
-
Field Detail
-
dimensions
private final int dimensions
-
basicType
private final Type basicType
-
-
Constructor Detail
-
ArrayType
public ArrayType(byte type, int dimensions)Convenience constructor for array type, for example int[]- Parameters:
type- array type, for example T_INT.dimensions- array dimensions.
-
ArrayType
public ArrayType(java.lang.String className, int dimensions)Convenience constructor for reference array type, for example Object[]- Parameters:
className- complete name of class (String, for example).dimensions- array dimensions.
-
ArrayType
public ArrayType(Type type, int dimensions)
Constructor for array of given type- Parameters:
type- type of array (may be an array itself).dimensions- array dimensions.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object type)
-
getBasicType
public Type getBasicType()
Gets the basic type of array, that is, for int[][][] the basic type is int.- Returns:
- basic type of array, that is, for int[][][] the basic type is int.
-
getClassName
public java.lang.String getClassName()
Gets the name of referenced class.- Overrides:
getClassNamein classType- Returns:
- name of referenced class.
- Since:
- 6.7.0
-
getDimensions
public int getDimensions()
Gets the number of dimensions of array.- Returns:
- number of dimensions of array.
-
getElementType
public Type getElementType()
Gets the element type of array, that is, for int[][][] the element type is int[][].- Returns:
- element type of array, that is, for int[][][] the element type is int[][].
-
-