Class ArrayType

    • Field Detail

      • arrayType

        private AnyType arrayType
      • nativeArrayType

        private AnyType nativeArrayType
      • 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 array
        manager - the manager which hold all StructTypes
        componentClassIndex - the running index of the component/array class/type
        options - 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 name
        kind - the kind, array or array_native
        manager - the manager which hold all StructTypes
        arrayType - 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 class TypeManager.StructType
        Returns:
        the unique index or -1 id not an array
      • isSubTypeOf

        public boolean isSubTypeOf​(AnyType type)
        Check if this is a sub type of given type.
        Specified by:
        isSubTypeOf in interface AnyType
        Overrides:
        isSubTypeOf in class TypeManager.StructType
        Parameters:
        type - type to check
        Returns:
        true, if both are identical or this is a sub type of other. Or if other is a parent type of this.