Package org.graalvm.word
Interface SignedWord
- All Superinterfaces:
ComparableWord
,WordBase
Represents a signed word-sized value.
- Since:
- 19.0
-
Method Summary
Modifier and TypeMethodDescriptionadd
(int val) Returns a Signed whose value is(this + val)
.add
(SignedWord val) Returns a Signed whose value is(this + val)
.and
(int val) Returns a Signed whose value is(this & val)
.and
(SignedWord val) Returns a Signed whose value is(this & val)
.boolean
equal
(int val) Compares this Signed with the specified value.boolean
equal
(SignedWord val) Compares this Signed with the specified value.boolean
greaterOrEqual
(int val) Compares this Signed with the specified value.boolean
greaterOrEqual
(SignedWord val) Compares this Signed with the specified value.boolean
greaterThan
(int val) Compares this Signed with the specified value.boolean
greaterThan
(SignedWord val) Compares this Signed with the specified value.boolean
lessOrEqual
(int val) Compares this Signed with the specified value.boolean
lessOrEqual
(SignedWord val) Compares this Signed with the specified value.boolean
lessThan
(int val) Compares this Signed with the specified value.boolean
lessThan
(SignedWord val) Compares this Signed with the specified value.multiply
(int val) Returns a Signed whose value is(this * val)
.multiply
(SignedWord val) Returns a Signed whose value is(this * val)
.not()
Returns a Signed whose value is(~this)
.boolean
notEqual
(int val) Compares this Signed with the specified value.boolean
notEqual
(SignedWord val) Compares this Signed with the specified value.or
(int val) Returns a Signed whose value is(this | val)
.or
(SignedWord val) Returns a Signed whose value is(this | val)
.shiftLeft
(int n) Returns a Signed whose value is(this << n)
.Returns a Signed whose value is(this << n)
.signedDivide
(int val) Returns a Signed whose value is(this / val)
.signedDivide
(SignedWord val) Returns a Signed whose value is(this / val)
.signedRemainder
(int val) Returns a Signed whose value is(this % val)
.Returns a Signed whose value is(this % val)
.signedShiftRight
(int n) Returns a Signed whose value is(this >> n)
.Returns a Signed whose value is(this >> n)
.subtract
(int val) Returns a Signed whose value is(this - val)
.subtract
(SignedWord val) Returns a Signed whose value is(this - val)
.xor
(int val) Returns a Signed whose value is(this ^ val)
.xor
(SignedWord val) Returns a Signed whose value is(this ^ val)
.Methods inherited from interface org.graalvm.word.ComparableWord
equal, notEqual
-
Method Details
-
add
Returns a Signed whose value is(this + val)
.- Parameters:
val
- value to be added to this Signed.- Returns:
this + val
- Since:
- 19.0
-
subtract
Returns a Signed whose value is(this - val)
.- Parameters:
val
- value to be subtracted from this Signed.- Returns:
this - val
- Since:
- 19.0
-
multiply
Returns a Signed whose value is(this * val)
.- Parameters:
val
- value to be multiplied by this Signed.- Returns:
this * val
- Since:
- 19.0
-
signedDivide
Returns a Signed whose value is(this / val)
.- Parameters:
val
- value by which this Signed is to be divided.- Returns:
this / val
- Since:
- 19.0
-
signedRemainder
Returns a Signed whose value is(this % val)
.- Parameters:
val
- value by which this Signed is to be divided, and the remainder computed.- Returns:
this % val
- Since:
- 19.0
-
shiftLeft
Returns a Signed whose value is(this << n)
.- Parameters:
n
- shift distance, in bits.- Returns:
this << n
- Since:
- 19.0
-
signedShiftRight
Returns a Signed whose value is(this >> n)
. Sign extension is performed.- Parameters:
n
- shift distance, in bits.- Returns:
this >> n
- Since:
- 19.0
-
and
Returns a Signed whose value is(this & val)
. (This method returns a negative Signed if and only if this and val are both negative.)- Parameters:
val
- value to be AND'ed with this Signed.- Returns:
this & val
- Since:
- 19.0
-
or
Returns a Signed whose value is(this | val)
. (This method returns a negative Signed if and only if either this or val is negative.)- Parameters:
val
- value to be OR'ed with this Signed.- Returns:
this | val
- Since:
- 19.0
-
xor
Returns a Signed whose value is(this ^ val)
. (This method returns a negative Signed if and only if exactly one of this and val are negative.)- Parameters:
val
- value to be XOR'ed with this Signed.- Returns:
this ^ val
- Since:
- 19.0
-
not
SignedWord not()Returns a Signed whose value is(~this)
. (This method returns a negative value if and only if this Signed is non-negative.)- Returns:
~this
- Since:
- 19.0
-
equal
Compares this Signed with the specified value.- Parameters:
val
- value to which this Signed is to be compared.- Returns:
this == val
- Since:
- 19.0
-
notEqual
Compares this Signed with the specified value.- Parameters:
val
- value to which this Signed is to be compared.- Returns:
this != val
- Since:
- 19.0
-
lessThan
Compares this Signed with the specified value.- Parameters:
val
- value to which this Signed is to be compared.- Returns:
this < val
- Since:
- 19.0
-
lessOrEqual
Compares this Signed with the specified value.- Parameters:
val
- value to which this Signed is to be compared.- Returns:
this <= val
- Since:
- 19.0
-
greaterThan
Compares this Signed with the specified value.- Parameters:
val
- value to which this Signed is to be compared.- Returns:
this > val
- Since:
- 19.0
-
greaterOrEqual
Compares this Signed with the specified value.- Parameters:
val
- value to which this Signed is to be compared.- Returns:
this >= val
- Since:
- 19.0
-
add
Returns a Signed whose value is(this + val)
.- Parameters:
val
- value to be added to this Signed.- Returns:
this + val
- Since:
- 19.0
-
subtract
Returns a Signed whose value is(this - val)
.- Parameters:
val
- value to be subtracted from this Signed.- Returns:
this - val
- Since:
- 19.0
-
multiply
Returns a Signed whose value is(this * val)
.- Parameters:
val
- value to be multiplied by this Signed.- Returns:
this * val
- Since:
- 19.0
-
signedDivide
Returns a Signed whose value is(this / val)
.- Parameters:
val
- value by which this Signed is to be divided.- Returns:
this / val
- Since:
- 19.0
-
signedRemainder
Returns a Signed whose value is(this % val)
.- Parameters:
val
- value by which this Signed is to be divided, and the remainder computed.- Returns:
this % val
- Since:
- 19.0
-
shiftLeft
Returns a Signed whose value is(this << n)
.- Parameters:
n
- shift distance, in bits.- Returns:
this << n
- Since:
- 19.0
-
signedShiftRight
Returns a Signed whose value is(this >> n)
. Sign extension is performed.- Parameters:
n
- shift distance, in bits.- Returns:
this >> n
- Since:
- 19.0
-
and
Returns a Signed whose value is(this & val)
. (This method returns a negative Signed if and only if this and val are both negative.)- Parameters:
val
- value to be AND'ed with this Signed.- Returns:
this & val
- Since:
- 19.0
-
or
Returns a Signed whose value is(this | val)
. (This method returns a negative Signed if and only if either this or val is negative.)- Parameters:
val
- value to be OR'ed with this Signed.- Returns:
this | val
- Since:
- 19.0
-
xor
Returns a Signed whose value is(this ^ val)
. (This method returns a negative Signed if and only if exactly one of this and val are negative.)- Parameters:
val
- value to be XOR'ed with this Signed.- Returns:
this ^ val
- Since:
- 19.0
-
equal
boolean equal(int val) Compares this Signed with the specified value.- Parameters:
val
- value to which this Signed is to be compared.- Returns:
this == val
- Since:
- 19.0
-
notEqual
boolean notEqual(int val) Compares this Signed with the specified value.- Parameters:
val
- value to which this Signed is to be compared.- Returns:
this != val
- Since:
- 19.0
-
lessThan
boolean lessThan(int val) Compares this Signed with the specified value.- Parameters:
val
- value to which this Signed is to be compared.- Returns:
this < val
- Since:
- 19.0
-
lessOrEqual
boolean lessOrEqual(int val) Compares this Signed with the specified value.- Parameters:
val
- value to which this Signed is to be compared.- Returns:
this <= val
- Since:
- 19.0
-
greaterThan
boolean greaterThan(int val) Compares this Signed with the specified value.- Parameters:
val
- value to which this Signed is to be compared.- Returns:
this > val
- Since:
- 19.0
-
greaterOrEqual
boolean greaterOrEqual(int val) Compares this Signed with the specified value.- Parameters:
val
- value to which this Signed is to be compared.- Returns:
this >= val
- Since:
- 19.0
-