ca.disassembly
Class CodeUtils

java.lang.Object
  extended by ca.disassembly.CodeUtils

public final class CodeUtils
extends java.lang.Object


Method Summary
static java.lang.String collapseWhiteSpace(java.lang.String s)
           
static java.lang.String fourDigitHex(int value)
          This static method returns the given value as a 4 digit hex number.
static java.lang.String getDataString(int[] data)
           
static java.lang.String getNextFileInSequence(java.lang.String filename, java.lang.String sequence)
           
static boolean isValidData(java.lang.String s, int start)
          This static method checks to see if there is a byte value at the given location in the target string.
static java.lang.String padTo(java.lang.String s, int len)
          This static method pads the given string to the given length by appending white-space to the end.
static java.util.Map<java.lang.String,java.util.List<java.lang.String>> parseArgs(java.lang.String[] rules, java.lang.String[] args)
           
static java.lang.String replaceAll(java.lang.String source, java.lang.String key, java.lang.String value)
           
static int signedNumber(int bits, int value)
           
static java.lang.String twoDigitHex(int value)
          This static method returns the given value as a 2 digit hex number.
static java.lang.String twoOrFourDigitHex(int value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseArgs

public static java.util.Map<java.lang.String,java.util.List<java.lang.String>> parseArgs(java.lang.String[] rules,
                                                                                         java.lang.String[] args)

getNextFileInSequence

public static java.lang.String getNextFileInSequence(java.lang.String filename,
                                                     java.lang.String sequence)
                                              throws java.lang.Exception
Throws:
java.lang.Exception

isValidData

public static boolean isValidData(java.lang.String s,
                                  int start)
This static method checks to see if there is a byte value at the given location in the target string.

Parameters:
s - target string
start - starting point in the string
Returns:
length of number or -1 if not valid

fourDigitHex

public static java.lang.String fourDigitHex(int value)
This static method returns the given value as a 4 digit hex number.

Parameters:
value - the value to convert
Returns:
4 digit hex representation

twoDigitHex

public static java.lang.String twoDigitHex(int value)
This static method returns the given value as a 2 digit hex number.

Parameters:
value - the value to convert
Returns:
2 digit hex representation

twoOrFourDigitHex

public static java.lang.String twoOrFourDigitHex(int value)

replaceAll

public static java.lang.String replaceAll(java.lang.String source,
                                          java.lang.String key,
                                          java.lang.String value)

padTo

public static java.lang.String padTo(java.lang.String s,
                                     int len)
This static method pads the given string to the given length by appending white-space to the end.

Parameters:
s - the string to pad
len - the required length
Returns:
the padded string

collapseWhiteSpace

public static java.lang.String collapseWhiteSpace(java.lang.String s)

signedNumber

public static int signedNumber(int bits,
                               int value)

getDataString

public static java.lang.String getDataString(int[] data)