Top Description Constructors Methods
org.graalvm.word

public final Class WordFactory

extends Object
Class Inheritance
Imports
org.graalvm.word.impl.WordBoxFactory, .WordFactoryOpcode, .WordFactoryOperation

Provides factory method to create machine-word-sized values.
Since
19.0

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <T extends PointerBase> T

Returns:

the null pointer.
nullPointer
()

The null pointer, i.e., the pointer with no bits set.

public static <T extends PointerBase> T

Returns:

the value cast to PointerBase
pointer
(long
a 64 bit unsigned value
val
)

Unsafe conversion from a Java long value to a pointer.

public static <T extends SignedWord> T

Returns:

the value cast to Word
signed
(long
a 64 bit signed value
val
)

Unsafe conversion from a Java long value to a Word.

public static <T extends SignedWord> T

Returns:

the value cast to Word
signed
(int
a 32 bit signed value
val
)

Unsafe conversion from a Java int value to a Word.

public static <T extends UnsignedWord> T

Returns:

the value cast to Word
unsigned
(long
a 64 bit unsigned value
val
)

Unsafe conversion from a Java long value to a Word.

public static <T extends UnsignedWord> T

Returns:

the value cast to Word
unsigned
(int
a 32 bit unsigned value
val
)

Unsafe conversion from a Java int value to a Word.

public static <T extends WordBase> T

Returns:

the constant 0.
zero
()

The constant 0, i.e., the word with no bits set.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

WordFactoryback to summary
private WordFactory()

Method Detail

nullPointerback to summary
public static <T extends PointerBase> T nullPointer()

The null pointer, i.e., the pointer with no bits set. There is no difference to a signed or unsigned zero.

Returns:T

the null pointer.

Annotations
@WordFactoryOperation
opcode:ZERO
Since
19.0
pointerback to summary
public static <T extends PointerBase> T pointer(long val)

Unsafe conversion from a Java long value to a pointer. The parameter is treated as an unsigned 64-bit value (in contrast to the semantics of a Java long).

Parameters
val:long

a 64 bit unsigned value

Returns:T

the value cast to PointerBase

Annotations
@WordFactoryOperation
opcode:FROM_UNSIGNED
Since
19.0
signedback to summary
public static <T extends SignedWord> T signed(long val)

Unsafe conversion from a Java long value to a Word. The parameter is treated as a signed 64-bit value (unchanged semantics of a Java long).

Parameters
val:long

a 64 bit signed value

Returns:T

the value cast to Word

Annotations
@WordFactoryOperation
opcode:FROM_SIGNED
Since
19.0
signedback to summary
public static <T extends SignedWord> T signed(int val)

Unsafe conversion from a Java int value to a Word. The parameter is treated as a signed 32-bit value (unchanged semantics of a Java int).

Parameters
val:int

a 32 bit signed value

Returns:T

the value cast to Word

Annotations
@WordFactoryOperation
opcode:FROM_SIGNED
Since
19.0
unsignedback to summary
public static <T extends UnsignedWord> T unsigned(long val)

Unsafe conversion from a Java long value to a Word. The parameter is treated as an unsigned 64-bit value (in contrast to the semantics of a Java long).

Parameters
val:long

a 64 bit unsigned value

Returns:T

the value cast to Word

Annotations
@WordFactoryOperation
opcode:FROM_UNSIGNED
Since
19.0
unsignedback to summary
public static <T extends UnsignedWord> T unsigned(int val)

Unsafe conversion from a Java int value to a Word. The parameter is treated as an unsigned 32-bit value (in contrast to the semantics of a Java int).

Parameters
val:int

a 32 bit unsigned value

Returns:T

the value cast to Word

Annotations
@WordFactoryOperation
opcode:FROM_UNSIGNED
Since
19.0
zeroback to summary
public static <T extends WordBase> T zero()

The constant 0, i.e., the word with no bits set. There is no difference between a signed and unsigned zero.

Returns:T

the constant 0.

Annotations
@WordFactoryOperation
opcode:ZERO
Since
19.0