jmce.util
Class Hex
java.lang.Object
jmce.util.Hex
public class Hex
- extends java.lang.Object
Class to format work with hex number. Provide conversion from
inteer to String and String to interger. The class cannot be
instanced and all method are static.
- Version:
- 1.01
- Author:
- Mario Viara
Method Summary |
static java.lang.String |
formatByte(int value)
|
static java.lang.String |
formatDword(int value)
|
static java.lang.String |
formatValue(int value,
int len)
|
static java.lang.String |
formatWord(int value)
|
static int |
getByte(java.lang.String line,
int pos)
|
static int |
getDigit(java.lang.String line,
int pos)
|
static int |
getHex(java.lang.String line,
int pos,
int len)
Return the binary value of variable lenghet hex string. |
static int |
getWord(java.lang.String line,
int pos)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
formatValue
public static java.lang.String formatValue(int value,
int len)
formatByte
public static java.lang.String formatByte(int value)
formatDword
public static java.lang.String formatDword(int value)
formatWord
public static java.lang.String formatWord(int value)
getHex
public static int getHex(java.lang.String line,
int pos,
int len)
throws SIMException
- Return the binary value of variable lenghet hex string.
- Parameters:
line
- - String with the hex number.pos
- - Start positionlen
- - Len in digit.
- Returns:
- The binary value.
- Throws:
SIMException
- Since:
- 1.02
getWord
public static int getWord(java.lang.String line,
int pos)
throws SIMException
- Throws:
SIMException
getByte
public static int getByte(java.lang.String line,
int pos)
throws SIMException
- Throws:
SIMException
getDigit
public static int getDigit(java.lang.String line,
int pos)
throws SIMException
- Throws:
SIMException