|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Number net.sourceforge.juint.UInt32
public class UInt32
Unsigned 32-bit integer.
Field Summary | |
---|---|
static long |
MAX_VALUE
The largest possible value. |
static long |
MIN_VALUE
The smallest possible value. |
Constructor Summary | |
---|---|
UInt32(byte[] doubleWord)
Creates a new instance from a byte array. |
|
UInt32(int doubleWord)
Creates a new instance from an int . |
|
UInt32(long doubleWord)
Creates a new instance from a long . |
|
UInt32(short doubleWord)
Creates a new instance from a short . |
Method Summary | |
---|---|
UInt32 |
addBitmask(UInt32 bitmask)
Sets the bits in the given bitmask. |
UInt32 |
and(UInt32 number)
Logical and. |
int |
compareTo(java.lang.Object object)
Compares this UInt32 to another UInt32 for order. |
double |
doubleValue()
Gets the value as a double . |
boolean |
equals(java.lang.Object object)
Compares this UInt32 to anoter UInt32 for equality. |
float |
floatValue()
Gets the value as a float . |
boolean |
hasBitmask(UInt32 bitmask)
Determines if this number has the given bitmask. |
int |
hashCode()
Gets the hash code. |
int |
intValue()
Gets the value as an int . |
long |
longValue()
Gets the value as a long . |
UInt32 |
not()
Logical not. |
UInt32 |
or(UInt32 number)
Logical or. |
UInt32 |
removeBitmask(UInt32 bitmask)
Unsets the bits in the given bitmask. |
byte[] |
toBigEndian()
Gets the value as a byte array. |
byte[] |
toLittleEndian()
Gets the value as a byte array. |
java.lang.String |
toString()
Gets the value as a String . |
long |
uint32Value()
Gets the value as an unsigned 32-bit integer. |
static UInt32 |
valueOfBigEndian(byte[] doubleWord)
Creates a new instance from a byte array. |
static UInt32 |
valueOfLittleEndian(byte[] doubleWord)
Creates a new instance from a byte array. |
UInt32 |
xor(UInt32 number)
Logical xor. |
Methods inherited from class java.lang.Number |
---|
byteValue, shortValue |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long MAX_VALUE
4294967295L
public static final long MIN_VALUE
0L
Constructor Detail |
---|
public UInt32(byte[] doubleWord) throws java.lang.IllegalArgumentException
byte
array. The array must have a length of 4
and be in big-endian byte order.
doubleWord
- the value to be represented
java.lang.IllegalArgumentException
- if doubleWord
is null
or if the length does not
equal 4public UInt32(short doubleWord)
short
.
doubleWord
- the value to be representedpublic UInt32(int doubleWord)
int
.
doubleWord
- the value to be representedpublic UInt32(long doubleWord)
long
.
doubleWord
- the value to be representedMethod Detail |
---|
public static UInt32 valueOfBigEndian(byte[] doubleWord) throws java.lang.IllegalArgumentException
byte
array. The array must have a length of 4
and be in big-endian byte order.
doubleWord
- the value to be represented
java.lang.IllegalArgumentException
- if doubleWord
is null
or if the length does not
equal 4public static UInt32 valueOfLittleEndian(byte[] doubleWord) throws java.lang.IllegalArgumentException
byte
array. The array must have a length of 4
and be in little-endian byte order.
doubleWord
- the value to be represented
java.lang.IllegalArgumentException
- if doubleWord
is null
or if the length does not
equal 4public long uint32Value()
public int intValue()
int
.
intValue
in class java.lang.Number
int
public long longValue()
long
.
longValue
in class java.lang.Number
long
public float floatValue()
float
.
floatValue
in class java.lang.Number
float
public double doubleValue()
double
.
doubleValue
in class java.lang.Number
double
public byte[] toBigEndian()
byte
array. The array will be in big-endian byte order and
have a length of 4.
byte
arraypublic byte[] toLittleEndian()
byte
array. The array will be in litte-endian byte order
and have a length of 4.
byte
arraypublic int compareTo(java.lang.Object object)
UInt32
to another UInt32
for order.
compareTo
in interface java.lang.Comparable
object
- a UInt32
public boolean equals(java.lang.Object object)
UInt32
to anoter UInt32
for equality.
equals
in class java.lang.Object
object
- a UInt32
public int hashCode()
intValue()
.
hashCode
in class java.lang.Object
public java.lang.String toString()
String
.
toString
in class java.lang.Object
String
public UInt32 and(UInt32 number)
Bitwise
and
in interface Bitwise<UInt32>
public UInt32 not()
Bitwise
not
in interface Bitwise<UInt32>
public UInt32 or(UInt32 number)
Bitwise
or
in interface Bitwise<UInt32>
public UInt32 xor(UInt32 number)
Bitwise
xor
in interface Bitwise<UInt32>
public UInt32 addBitmask(UInt32 bitmask)
Bitwise
addBitmask
in interface Bitwise<UInt32>
public boolean hasBitmask(UInt32 bitmask)
Bitwise
hasBitmask
in interface Bitwise<UInt32>
true
if the number has the bitmask; false
otherwisepublic UInt32 removeBitmask(UInt32 bitmask)
Bitwise
removeBitmask
in interface Bitwise<UInt32>
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |