Enum ValueType

java.lang.Object
java.lang.Enum<ValueType>
com.dylibso.chicory.wasm.types.ValueType
All Implemented Interfaces:
Serializable, Comparable<ValueType>

public enum ValueType extends Enum<ValueType>
The possible WASM value types.
  • Enum Constant Details

  • Method Details

    • values

      public static ValueType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ValueType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • id

      public int id()
      Returns:
      the numerical identifier for this type
    • size

      public int size()
      Returns:
      the size of this type in memory
      Throws:
      IllegalStateException - if the type cannot be stored in memory
    • isNumeric

      public boolean isNumeric()
      Returns:
      true if the type is a numeric type, or false otherwise
    • isInteger

      public boolean isInteger()
      Returns:
      true if the type is an integer type, or false otherwise
    • isFloatingPoint

      public boolean isFloatingPoint()
      Returns:
      true if the type is a floating-point type, or false otherwise
    • isReference

      public boolean isReference()
      Returns:
      true if the type is a reference type, or false otherwise
    • isValid

      public static boolean isValid(int typeId)
      Returns:
      true if the given type ID is a valid value type ID, or false if it is not
    • forId

      public static ValueType forId(int id)
      Returns:
      the ValueType for the given ID value
      Throws:
      IllegalArgumentException - if the ID value does not correspond to a valid value type
    • refTypeForId

      public static ValueType refTypeForId(int id)
      Returns:
      the reference-typed ValueType for the given ID value
      Throws:
      IllegalArgumentException - if the ID value does not correspond to a valid reference type
    • sizeOf

      public static int sizeOf(List<ValueType> args)