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 Type
basicType
private int
dimensions
-
Constructor Summary
Constructors Constructor Description ArrayType(byte type, int dimensions)
Convenience constructor for array type, e.g.ArrayType(java.lang.String className, int dimensions)
Convenience constructor for reference array type, e.g.ArrayType(Type type, int dimensions)
Constructor for array of given type
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object type)
Type
getBasicType()
java.lang.String
getClassName()
Gets the name of referenced class.int
getDimensions()
Type
getElementType()
int
hashCode()
-
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, normalizeForStackOrLocal, setSignature, 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, e.g. int[]- Parameters:
type
- array type, e.g. T_INTdimensions
- array dimensions
-
ArrayType
public ArrayType(java.lang.String className, int dimensions)
Convenience constructor for reference array type, e.g. Object[]- Parameters:
className
- complete name of class (java.lang.String, e.g.)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()
- Returns:
- basic type of array, i.e., for int[][][] the basic type is int
-
getClassName
public java.lang.String getClassName()
Gets the name of referenced class.- Overrides:
getClassName
in classType
- Returns:
- name of referenced class.
- Since:
- 6.7.0
-
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[][]
-
-