|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object frysk.gui.common.UBigInteger
public class UBigInteger
Some utility functions for treating BigIntegers as unsigned integers.
Constructor Summary | |
---|---|
UBigInteger()
|
Method Summary | |
---|---|
private static BigInteger |
makeMask(int integerLength)
|
static BigInteger |
mask(BigInteger val,
int integerLength)
Mask off the lower bits of a BigInteger, replacing the upper bits with zeros (obviously). |
static BigInteger |
signExtend(BigInteger val,
int integerLength)
Treat the MSB of an unsigned integer stored in a BigInteger as a sign bit and return a positive or negative BigInteger as appropriate. |
static String |
toString(BigInteger val,
int integerLength,
int radix)
Print the string representation of an unsigned integer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UBigInteger()
Method Detail |
---|
private static BigInteger makeMask(int integerLength)
public static BigInteger mask(BigInteger val, int integerLength)
val
- BigInteger valueintegerLength
- length of bits to preserve
public static String toString(BigInteger val, int integerLength, int radix)
val
- the BigInteger holding the unsigned integerintegerLength
- length of unsigned integerradix
- of output
public static BigInteger signExtend(BigInteger val, int integerLength)
val
- the BigInteger valueintegerLength
- length of unsigned integer, or 1 plus bit
position of sign bit.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |