|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcds.util.Integers
Static methods dealing with int variables
| Field Summary | |
private static int[] |
mask10
|
static int[] |
pow10
|
| Constructor Summary | |
Integers()
|
|
| Method Summary | |
static int |
extract(int num,
int pos,
int lg)
Extracts from an integer lg bits from a given position |
static int |
insert(int num,
int n,
int pos,
int lg)
Inserts in a integer another number on nbits at a given position |
static int |
nbBytes(int num)
Computes the number of bytes needed by the integer (from 1 to 4) |
static int |
nbdigits(int num)
Computes the number of decimal digits of an integer |
static int |
parseInt(java.lang.String str)
Parse an integer string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int[] pow10
private static final int[] mask10
| Constructor Detail |
public Integers()
| Method Detail |
public static int nbdigits(int num)
num - integer
public static int nbBytes(int num)
num - integer
public static int insert(int num,
int n,
int pos,
int lg)
throws java.text.ParseException
num - integer in which to insert nn - number toinsert (lg bits will be used)pos - position from which the number n must be inserted
(0 is the leftmost bit, 31 is the last possible position to insert 1 bit)lg - number of bits from n to insert. pos+lg <= 32
java.text.ParseException - if the number is incorrect
public static int extract(int num,
int pos,
int lg)
num - integer fromwhich to extract the bitspos - position from which the bits should be extracted
(0 is the leftmost bit, 31 is the last possible position to extract 1 bit)lg - number of bits to extract. pos+lg <= 32
public static int parseInt(java.lang.String str)
throws java.lang.NumberFormatException
str - string to analyse as a number. The accepted syntax is:java.lang.NumberFormatException - if the number fails to be analyzed
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||