Package com.dylibso.chicory.wasm.types
Enum ValueType
- All Implemented Interfaces:
Serializable,Comparable<ValueType>
The possible WASM value types.
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic ValueTypeforId(int id) intid()booleanbooleanbooleanbooleanstatic booleanisValid(int typeId) static ValueTyperefTypeForId(int id) intsize()static intstatic ValueTypeReturns the enum constant of this type with the specified name.static ValueType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
UNKNOWN
-
F64
-
F32
-
I64
-
I32
-
V128
-
FuncRef
-
ExnRef
-
ExternRef
-
-
Method Details
-
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
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 nameNullPointerException- 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:
trueif the type is a numeric type, orfalseotherwise
-
isInteger
public boolean isInteger()- Returns:
trueif the type is an integer type, orfalseotherwise
-
isFloatingPoint
public boolean isFloatingPoint()- Returns:
trueif the type is a floating-point type, orfalseotherwise
-
isReference
public boolean isReference()- Returns:
trueif the type is a reference type, orfalseotherwise
-
isValid
public static boolean isValid(int typeId) - Returns:
trueif the given type ID is a valid value type ID, orfalseif it is not
-
forId
- Returns:
- the
ValueTypefor the given ID value - Throws:
IllegalArgumentException- if the ID value does not correspond to a valid value type
-
refTypeForId
- Returns:
- the reference-typed
ValueTypefor the given ID value - Throws:
IllegalArgumentException- if the ID value does not correspond to a valid reference type
-
sizeOf
-