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 AnyType
private int
private AnyType
private NamedStorageType
-
Constructor Summary
ConstructorsModifierConstructorDescriptionArrayType
(AnyType arrayType, TypeManager manager, int componentClassIndex, WasmOptions options) Create a new array typeprivate
ArrayType
(String name, TypeManager.StructTypeKind kind, TypeManager manager, AnyType arrayType) Create a new instance -
Method Summary
Modifier and TypeMethodDescriptionThe element type of the arrayprotected int
The running index of the component/array class/type for class meta data, instanceof and interface calls.private static String
getJavaClassName
(AnyType arrayType) Create class name for the array class.The native webassembly array type that we wrapThe native field nameboolean
If the type is a reference type.boolean
isSubTypeOf
(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 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
Create class name for the array class.- Parameters:
arrayType
- the type of the array- Returns:
- the name
-
getArrayType
The element type of the array- Returns:
- the type
-
getNativeArrayType
The native webassembly array type that we wrap- Returns:
- the type
-
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:
getComponentClassIndex
in 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:
isRefType
in interfaceAnyType
- Overrides:
isRefType
in classTypeManager.StructType
- Returns:
- true, is GC type
-
isSubTypeOf
Check if this is a sub type of given type.- Specified by:
isSubTypeOf
in interfaceAnyType
- Overrides:
isSubTypeOf
in classTypeManager.StructType
- Parameters:
type
- type to check- Returns:
- true, if both are identical or this is a sub type of
other
. Or ifother
is a parent type of this.
-