|
JAPI 0.9.0 Yet another Java API API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.japi.io.BCD
public final class BCD
A class with methods for converting BCD data from and to Binary data.
Currently only int is supported.
Probably net.sf.japi.io
is not the ideal package for this class, yet it seems most appropriate.
Method Summary | |
---|---|
static int |
base10(int n)
Return the 10 base (10^n). |
static int |
bcd2int(int bcd)
Convert a BCD value to an int value. |
static void |
check(int bcd)
Check wether a BCD value is correct. |
static int |
correct(int bcd)
Perform a BCD correction. |
static int |
int2bcd(int val)
Convert an int value to a BCD value. |
static boolean |
isBcd(int bcd)
Check wether a BCD value is correct. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int bcd2int(int bcd)
bcd
- BCD value
public static int int2bcd(int val)
val
- int value
public static void check(int bcd)
bcd
- number to checkpublic static boolean isBcd(int bcd)
bcd
- bcd value to check
true
if supplied value is bcd, otherwise false
public static int base10(int n)
n
- power
10^n
public static int correct(int bcd)
bcd
- bcd value to correct
|
JAPI Yet another Java API API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |