Package org.graalvm.word
Class WordFactory
java.lang.Object
org.graalvm.word.WordFactory
Provides factory method to create machine-word-sized values.
- Since:
- 19.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends PointerBase>
TThe null pointer, i.e., the pointer with no bits set.static <T extends PointerBase>
Tpointer
(long val) Unsafe conversion from a Java long value to apointer
.static <T extends SignedWord>
Tsigned
(int val) Unsafe conversion from a Java int value to a Word.static <T extends SignedWord>
Tsigned
(long val) Unsafe conversion from a Java long value to a Word.static <T extends UnsignedWord>
Tunsigned
(int val) Unsafe conversion from a Java int value to a Word.static <T extends UnsignedWord>
Tunsigned
(long val) Unsafe conversion from a Java long value to a Word.static <T extends WordBase>
Tzero()
The constant 0, i.e., the word with no bits set.
-
Method Details
-
zero
The constant 0, i.e., the word with no bits set. There is no difference between a signed and unsigned zero.- Returns:
- the constant 0.
- Since:
- 19.0
-
nullPointer
The null pointer, i.e., the pointer with no bits set. There is no difference to a signed or unsignedzero()
.- Returns:
- the null pointer.
- Since:
- 19.0
-
unsigned
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
- a 64 bit unsigned value- Returns:
- the value cast to Word
- Since:
- 19.0
-
pointer
Unsafe conversion from a Java long value to apointer
. The parameter is treated as an unsigned 64-bit value (in contrast to the semantics of a Java long).- Parameters:
val
- a 64 bit unsigned value- Returns:
- the value cast to PointerBase
- Since:
- 19.0
-
unsigned
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
- a 32 bit unsigned value- Returns:
- the value cast to Word
- Since:
- 19.0
-
signed
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
- a 64 bit signed value- Returns:
- the value cast to Word
- Since:
- 19.0
-
signed
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
- a 32 bit signed value- Returns:
- the value cast to Word
- Since:
- 19.0
-