|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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 SQUAWKPRIMITIVE
and programming with it requires adhering to the restrictions implied by this
attribute. Some of these constraints are imposed to keep the job of the
translator simple. All of these constraints are currently enforced by the
translator. The constraints are:
null
) than T.
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 |
hashCode()
Gets a hashcode value for this word which is just the value itself. |
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. |
String |
toString()
Gets a string representation of this word. |
static UWord |
zero()
Gets the canonical UWord representation of null . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static UWord fromPrimitive(int value) throws NativePragma
value
- a word expressed as an int or long
value
NativePragma
public int toPrimitive() throws NativePragma
NativePragma
public int toInt() throws NativePragma
NativePragma
public Offset toOffset() throws NativePragma
NativePragma
public static UWord zero() throws NativePragma
null
.
null
NativePragma
public static UWord max() throws NativePragma
NativePragma
public UWord or(UWord word) throws NativePragma
word
- the word to OR this word with
NativePragma
public UWord and(UWord word) throws NativePragma
word
- the word to AND this word with
NativePragma
public boolean isZero() throws NativePragma
NativePragma
public boolean isMax() throws NativePragma
max
.
max
NativePragma
public boolean eq(UWord word2) throws NativePragma
word2
- the word to compare this word against
word2
NativePragma
public boolean ne(UWord word2) throws NativePragma
word2
- the word to compare this word against
word2
NativePragma
public boolean lo(UWord word2) throws NativePragma
word2
- the word to compare this word against
word2
NativePragma
public boolean loeq(UWord word2) throws NativePragma
word2
- the word to compare this word against
word2
NativePragma
public boolean hi(UWord word2) throws NativePragma
word2
- the word to compare this word against
word2
NativePragma
public boolean hieq(UWord word2) throws NativePragma
word2
- the word to compare this word against
word2
NativePragma
public int hashCode() throws HostedPragma
hashCode
in class Object
HostedPragma
Object.equals(java.lang.Object)
,
Hashtable
public String toString() throws HostedPragma
toString
in class Object
HostedPragma
|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |