com.ibutton.tmex.utils
Class HexUtilities
java.lang.Object
|
+--com.ibutton.tmex.utils.HexUtilities
- public class HexUtilities
- extends java.lang.Object
HexUtilities is a class to that contains hex conversion methods.
|
Method Summary |
static int |
hexStringtoInt(java.lang.String hexString)
Convert the supplied hex string to an integer |
static java.lang.String |
toHexString(int dataToConvert)
Convert the supplied integer to a hex string without leading zeros |
static java.lang.String |
toHexString(int dataToConvert,
int digits)
Convert the supplied integer to a hex string with a set number
of digits. |
static java.lang.String |
toHexString(short dataToConvert)
Convert the supplied short to a 4 character hex string. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
HexUtilities
public HexUtilities()
toHexString
public static java.lang.String toHexString(int dataToConvert)
- Convert the supplied integer to a hex string without leading zeros
- Parameters:
dataToConvert - data value to convert to a hex string
toHexString
public static java.lang.String toHexString(int dataToConvert,
int digits)
- Convert the supplied integer to a hex string with a set number
of digits. If the number requires more digits then they will
be supplied.
- Parameters:
dataToConvert - data value to convert to a hex stringdigits - number of digits to return minimum
(-1 for no leading zeros)
toHexString
public static java.lang.String toHexString(short dataToConvert)
- Convert the supplied short to a 4 character hex string.
- Parameters:
dataToConvert - data value to convert to a hex string
hexStringtoInt
public static int hexStringtoInt(java.lang.String hexString)
- Convert the supplied hex string to an integer
- Parameters:
hexString - hex string to convert to an int