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 AnyType
arrayType
private int
componentClassIndex
private AnyType
nativeArrayType
private NamedStorageType
nativeFieldName
-
Constructor Summary
Constructors Modifier Constructor Description ArrayType(AnyType arrayType, TypeManager manager, int componentClassIndex, WasmOptions options)
Create a new array typeprivate
ArrayType(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 AnyType
getArrayType()
The element type of the arrayprotected int
getComponentClassIndex()
The running index of the component/array class/type for class meta data, instanceof and interface calls.private static java.lang.String
getJavaClassName(AnyType arrayType)
Create class name for the array class.AnyType
getNativeArrayType()
The native webassembly array type that we wrapNamedStorageType
getNativeFieldName()
The native field nameboolean
isRefType()
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 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:
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
public boolean isSubTypeOf(AnyType type)
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.
-
-