|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.at4j.support.lang.SignedInteger
public class SignedInteger
This class represents a signed integer value (i.e. a plain int
value). If the Integer
class had not been declared final
, this class would probably have extended it.
Signed integer objects are created by calling any of the static creation methods on this class.
Instances of this class are immutable.
UnsignedInteger
,
SignedLong
Field Summary | |
---|---|
static SignedInteger |
ONE
This constant represents the value 1 . |
static SignedInteger |
ZERO
This constant represents the value 0 . |
Method Summary | |
---|---|
int |
compareTo(SignedInteger l2)
|
boolean |
equals(Object o)
|
static SignedInteger |
fromBigEndianByteArray(byte[] barr)
Create a signed integer value from an four bytes long big-endian byte array. |
static SignedInteger |
fromLittleEndianByteArray(byte[] barr)
Create a signed integer value from an four bytes long little-endian byte array. |
byte[] |
getBigEndianByteArray()
Get the signed integer value represented as a big-endian byte array (four bytes long). |
byte[] |
getLittleEndianByteArray()
Get the signed integer value represented as a little-endian byte array (four bytes long). |
int |
hashCode()
|
long |
intValue()
Get the signed integer value. |
String |
toString()
|
static SignedInteger |
valueOf(int value)
Create a new signed integer value. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final SignedInteger ZERO
0
.
public static final SignedInteger ONE
1
.
Method Detail |
---|
public static SignedInteger valueOf(int value)
value
- The integer value.
public long intValue()
public byte[] getBigEndianByteArray()
fromBigEndianByteArray(byte[])
,
getLittleEndianByteArray()
public static SignedInteger fromBigEndianByteArray(byte[] barr) throws IllegalArgumentException
barr
- The byte array. It must be four bytes long.
IllegalArgumentException
- If the byte array is not four bytes
long.getBigEndianByteArray()
,
fromLittleEndianByteArray(byte[])
public byte[] getLittleEndianByteArray()
getBigEndianByteArray()
,
fromBigEndianByteArray(byte[])
public static SignedInteger fromLittleEndianByteArray(byte[] barr) throws IllegalArgumentException
barr
- The byte array. It must be four bytes long.
IllegalArgumentException
- If the byte array is not four bytes
long.getLittleEndianByteArray()
,
fromBigEndianByteArray(byte[])
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public int compareTo(SignedInteger l2)
compareTo
in interface Comparable<SignedInteger>
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |