|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jgap.util.NumberKit
public class NumberKit
Utility routines related to numbers.
| Constructor Summary | |
|---|---|
NumberKit()
|
|
| Method Summary | |
|---|---|
static char[] |
asChars(byte a_in)
Transforms a byte to a character array of hex octets. |
static char[] |
asChars(byte a_in,
int a_length)
Transforms a byte to a character array of hex octets. |
static int |
hexValue(char a_c)
Returns the hex value of "c" or -1 if there is no corresponding hex value. |
static java.lang.String |
niceDecimalNumber(double a_number,
int a_decimals)
Removes decimal places if there are more than a_decimals. |
static java.lang.String |
niceNumber(int a_number,
int a_places,
char a_filler)
Formats a number as a string having the total length of a_places, filling up needed characters with a_filler. |
static short |
parseShort(java.lang.String s)
Parses a short from a hex encoded number. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NumberKit()
| Method Detail |
|---|
public static int hexValue(char a_c)
a_c - hex character to convert
public static char[] asChars(byte a_in)
a_in - the byte
public static char[] asChars(byte a_in,
int a_length)
a_in - the bytea_length - the number of octets to produce
public static short parseShort(java.lang.String s)
throws java.lang.NullPointerException
s - the String to extract a short from, may not be null
java.lang.NullPointerException - if the String is null
public static java.lang.String niceNumber(int a_number,
int a_places,
char a_filler)
a_number - the number to formata_places - total length of output stringa_filler - fill character
public static java.lang.String niceDecimalNumber(double a_number,
int a_decimals)
a_number - the number to convert to a stringa_decimals - maximum number of decimal places allowed
|
JGAP | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||