|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.lang.Number
net.sourceforge.juint.Int32
public class Int32
Signed 32-bit integer.
| Field Summary | |
|---|---|
static int |
MAX_VALUE
The largest possible value. |
static int |
MIN_VALUE
The smallest possible value. |
| Constructor Summary | |
|---|---|
Int32(byte[] doubleWord)
Creates a new instance from a byte array. |
|
Int32(int doubleWord)
Creates a new instance from an int. |
|
Int32(long doubleWord)
Creates a new instance from a long. |
|
Int32(short doubleWord)
Creates a new instance from a short. |
|
| Method Summary | |
|---|---|
Int32 |
addBitmask(Int32 bitmask)
Sets the bits in the given bitmask. |
Int32 |
and(Int32 number)
Logical and. |
int |
compareTo(java.lang.Object object)
Compares this Int32 to another Int32 for order. |
double |
doubleValue()
Gets the value as a double. |
boolean |
equals(java.lang.Object object)
Gets the value as a byte array. |
float |
floatValue()
Gets the value as a float. |
boolean |
hasBitmask(Int32 bitmask)
Determines if this number has the given bitmask. |
int |
hashCode()
Gets the hash code. |
int |
int32Value()
Gets the value as a signed 32-bit integer. |
int |
intValue()
Gets the value as an int. |
long |
longValue()
Gets the value as a long. |
Int32 |
not()
Logical not. |
Int32 |
or(Int32 number)
Logical or. |
Int32 |
removeBitmask(Int32 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. |
static Int32 |
valueOfBigEndian(byte[] doubleWord)
Creates a new instance from a byte array. |
static Int32 |
valueOfLittleEndian(byte[] doubleWord)
Creates a new instance from a byte array. |
Int32 |
xor(Int32 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 int MAX_VALUE
2147483647
public static final int MIN_VALUE
-2147483648
| Constructor Detail |
|---|
public Int32(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 Int32(short doubleWord)
short.
doubleWord - the value to be representedpublic Int32(int doubleWord)
int.
doubleWord - the value to be representedpublic Int32(long doubleWord)
long.
doubleWord - the value to be represented| Method Detail |
|---|
public static Int32 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 4
public static Int32 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 int int32Value()
public int intValue()
int.
intValue in class java.lang.Numberintpublic long longValue()
long.
longValue in class java.lang.Numberlongpublic float floatValue()
float.
floatValue in class java.lang.Numberfloatpublic double doubleValue()
double.
doubleValue in class java.lang.Numberdoublepublic int compareTo(java.lang.Object object)
Int32 to another Int32 for order.
compareTo in interface java.lang.Comparableobject - a Int32public boolean equals(java.lang.Object object)
byte array. The array will be in litte-endian byte order
and have a length of 4.
equals in class java.lang.Objectbyte arraypublic int hashCode()
intValue().
hashCode in class java.lang.Objectpublic 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 java.lang.String toString()
String.
toString in class java.lang.ObjectStringpublic Int32 and(Int32 number)
Bitwise
and in interface Bitwise<Int32>public Int32 not()
Bitwise
not in interface Bitwise<Int32>public Int32 or(Int32 number)
Bitwise
or in interface Bitwise<Int32>public Int32 xor(Int32 number)
Bitwise
xor in interface Bitwise<Int32>public Int32 addBitmask(Int32 bitmask)
Bitwise
addBitmask in interface Bitwise<Int32>public boolean hasBitmask(Int32 bitmask)
Bitwise
hasBitmask in interface Bitwise<Int32>true if the number has the bitmask; false otherwisepublic Int32 removeBitmask(Int32 bitmask)
Bitwise
removeBitmask in interface Bitwise<Int32>
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||