|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.squawk.UWord
public final class UWord
The word type is used by the runtime system and collector to denote machine word-sized quantities. It is used instead of 'int' or 'Object' for coding clarity, machine-portability (it can map to 32 bit and 64 bit integral types) and access to unsigned operations (Java does not have unsigned int types).
This class is known specially by the translator as a Modifier#SQUAWKPRIMITIVE
and programming with it requires adhering to the restrictions implied by this
attribute.
Only the public methods of this class which do not override any of the
methods in java.lang.Object will be available in a non-hosted
environment. The translator replaces any calls to these methods to native
method calls.
This mechanism was largely inspired by the VM_Word class in the Jikes RVM.
Method Summary | |
---|---|
UWord |
and(UWord word)
Logically AND a word with this word. |
boolean |
eq(UWord word2)
Determines if this word is equal to a given word. |
static UWord |
fromPrimitive(int value)
Casts a word expressed as the appropriate Java primitive type for the platform (i.e. int or long) into a value of type UWord. |
boolean |
hi(UWord word2)
Determines if this word is higher than a given word. |
boolean |
hieq(UWord word2)
Determines if this word is higher than or equal to a given word. |
boolean |
isMax()
Determines if this word is equals to max . |
boolean |
isZero()
Determines if this word is 0. |
boolean |
lo(UWord word2)
Determines if this word is lower than a given word. |
boolean |
loeq(UWord word2)
Determines if this word is lower than or equal to a given word. |
static UWord |
max()
Gets the largest possible machine word. |
boolean |
ne(UWord word2)
Determines if this word is not equal to a given word. |
UWord |
or(UWord word)
Logically OR a word with this word. |
int |
toInt()
Casts a value of type UWord into an int. |
Offset |
toOffset()
Casts a value of type UWord into an Offset. |
int |
toPrimitive()
Casts a value of type UWord into the appropriate Java primitive type for the platform (i.e. int or long). |
static UWord |
zero()
Gets the canonical UWord representation of null . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public UWord and(UWord word)
word
- the word to AND this word with
public boolean eq(UWord word2)
word2
- the word to compare this word against
word2
public static UWord fromPrimitive(int value)
value
- a word expressed as an int or long
value
public boolean hi(UWord word2)
word2
- the word to compare this word against
word2
public boolean hieq(UWord word2)
word2
- the word to compare this word against
word2
public boolean isMax()
max
.
max
public boolean isZero()
public boolean lo(UWord word2)
word2
- the word to compare this word against
word2
public boolean loeq(UWord word2)
word2
- the word to compare this word against
word2
public static UWord max()
public boolean ne(UWord word2)
word2
- the word to compare this word against
word2
public UWord or(UWord word)
word
- the word to OR this word with
public int toInt()
public Offset toOffset()
public int toPrimitive()
public static UWord zero()
null
.
null
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |