Package com.tonic.analysis.ssa.type
Class ArrayType
- java.lang.Object
-
- com.tonic.analysis.ssa.type.ArrayType
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static ArrayTypefromDescriptor(String descriptor)Creates an array type from a descriptor string.IRTypegetBaseElementType()Gets the base element type for multi-dimensional arrays.StringgetDescriptor()intgetDimensions()IRTypegetElementType()intgetSize()inthashCode()booleanisArray()booleanisPrimitive()booleanisReference()booleanisTwoSlot()booleanisVoid()StringtoString()
-
-
-
Constructor Detail
-
ArrayType
public ArrayType(IRType elementType, int dimensions)
Creates an array type with specified element type and dimensions.- Parameters:
elementType- the element typedimensions- the number of dimensions
-
ArrayType
public ArrayType(IRType elementType)
Creates a single-dimensional array type.- Parameters:
elementType- the element type
-
-
Method Detail
-
getElementType
public IRType getElementType()
- Returns:
- the element type
-
getDimensions
public int getDimensions()
- Returns:
- the dimensions
-
fromDescriptor
public static ArrayType fromDescriptor(String descriptor)
Creates an array type from a descriptor string.- Parameters:
descriptor- the array descriptor- Returns:
- the array type
-
getDescriptor
public String getDescriptor()
- Specified by:
getDescriptorin interfaceIRType- Returns:
- the JVM type descriptor for this type
-
getSize
public int getSize()
-
isReference
public boolean isReference()
- Specified by:
isReferencein interfaceIRType- Returns:
- true for object and array types
-
isPrimitive
public boolean isPrimitive()
- Specified by:
isPrimitivein interfaceIRType- Returns:
- true for the eight primitive types
-
isVoid
public boolean isVoid()
-
isArray
public boolean isArray()
-
isTwoSlot
public boolean isTwoSlot()
-
getBaseElementType
public IRType getBaseElementType()
Gets the base element type for multi-dimensional arrays.- Returns:
- the innermost element type
-
-