Class ArrayType
- java.lang.Object
-
- de.inetsoftware.jwebassembly.module.TypeManager.StructType
-
- de.inetsoftware.jwebassembly.wasm.ArrayType
-
- All Implemented Interfaces:
AnyType
public class ArrayType extends TypeManager.StructType
A reference to an array type
-
-
Field Summary
Fields Modifier and Type Field Description private AnyTypearrayTypeprivate intcomponentClassIndexprivate AnyTypenativeArrayTypeprivate NamedStorageTypenativeFieldName
-
Constructor Summary
Constructors Modifier Constructor Description ArrayType(AnyType arrayType, TypeManager manager, int componentClassIndex, WasmOptions options)Create a new array typeprivateArrayType(java.lang.String name, TypeManager.StructTypeKind kind, TypeManager manager, AnyType arrayType)Create a new instance
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AnyTypegetArrayType()The element type of the arrayprotected intgetComponentClassIndex()The running index of the component/array class/type for class meta data, instanceof and interface calls.private static java.lang.StringgetJavaClassName(AnyType arrayType)Create class name for the array class.AnyTypegetNativeArrayType()The native webassembly array type that we wrapNamedStorageTypegetNativeFieldName()The native field namebooleanisRefType()If the type is a reference type.booleanisSubTypeOf(AnyType type)Check if this is a sub type of given type.-
Methods inherited from class de.inetsoftware.jwebassembly.module.TypeManager.StructType
getClassIndex, getCode, getFields, getKind, getName, getVTable, toString, writeToStream
-
-
-
-
Field Detail
-
arrayType
private AnyType arrayType
-
nativeArrayType
private AnyType nativeArrayType
-
nativeFieldName
private NamedStorageType nativeFieldName
-
componentClassIndex
private int componentClassIndex
-
-
Constructor Detail
-
ArrayType
public ArrayType(AnyType arrayType, @Nonnull TypeManager manager, int componentClassIndex, WasmOptions options)
Create a new array type- Parameters:
arrayType- the type of the arraymanager- the manager which hold all StructTypescomponentClassIndex- the running index of the component/array class/typeoptions- compiler properties
-
ArrayType
private ArrayType(@Nonnull java.lang.String name, @Nonnull TypeManager.StructTypeKind kind, @Nonnull TypeManager manager, AnyType arrayType)Create a new instance- Parameters:
name- the type namekind- the kind, array or array_nativemanager- the manager which hold all StructTypesarrayType- the type of the array
-
-
Method Detail
-
getJavaClassName
@Nonnull private static java.lang.String getJavaClassName(AnyType arrayType)
Create class name for the array class.- Parameters:
arrayType- the type of the array- Returns:
- the name
-
getArrayType
public AnyType getArrayType()
The element type of the array- Returns:
- the type
-
getNativeArrayType
public AnyType getNativeArrayType()
The native webassembly array type that we wrap- Returns:
- the type
-
getNativeFieldName
public NamedStorageType getNativeFieldName()
The native field name- Returns:
- the field name
-
getComponentClassIndex
protected int getComponentClassIndex()
The running index of the component/array class/type for class meta data, instanceof and interface calls.- Overrides:
getComponentClassIndexin classTypeManager.StructType- Returns:
- the unique index or -1 id not an array
-
isRefType
public boolean isRefType()
If the type is a reference type. A GC reference to the heap.- Specified by:
isRefTypein interfaceAnyType- Overrides:
isRefTypein classTypeManager.StructType- Returns:
- true, is GC type
-
isSubTypeOf
public boolean isSubTypeOf(AnyType type)
Check if this is a sub type of given type.- Specified by:
isSubTypeOfin interfaceAnyType- Overrides:
isSubTypeOfin classTypeManager.StructType- Parameters:
type- type to check- Returns:
- true, if both are identical or this is a sub type of
other. Or ifotheris a parent type of this.
-
-