Class ArrayType
java.lang.Object
de.inetsoftware.jwebassembly.module.TypeManager.StructType
de.inetsoftware.jwebassembly.wasm.ArrayType
- All Implemented Interfaces:
AnyType
A reference to an array type
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AnyTypeprivate intprivate AnyTypeprivate NamedStorageType -
Constructor Summary
ConstructorsModifierConstructorDescriptionArrayType(AnyType arrayType, TypeManager manager, int componentClassIndex, WasmOptions options) Create a new array typeprivateArrayType(String name, TypeManager.StructTypeKind kind, TypeManager manager, AnyType arrayType) Create a new instance -
Method Summary
Modifier and TypeMethodDescriptionThe element type of the arrayprotected intThe running index of the component/array class/type for class meta data, instanceof and interface calls.private static StringgetJavaClassName(AnyType arrayType) Create class name for the array class.The native webassembly array type that we wrapThe native field namebooleanIf the type is a reference type.booleanisSubTypeOf(AnyType type) Check if this is a sub type of given type.Methods inherited from class TypeManager.StructType
getClassIndex, getCode, getFields, getKind, getName, getVTable, toString, writeToStream
-
Field Details
-
arrayType
-
nativeArrayType
-
nativeFieldName
-
componentClassIndex
private int componentClassIndex
-
-
Constructor Details
-
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 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 Details
-
getJavaClassName
-
getArrayType
-
getNativeArrayType
The native webassembly array type that we wrap- Returns:
- the type
-
getNativeFieldName
-
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
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.
-