rcx.rcxdirect
Class RCXMath

java.lang.Object
  extended by rcx.rcxdirect.RCXMath

public class RCXMath
extends java.lang.Object

This class provides some basic RCXMath operations.

Version:
0.1.3, 05/01/00
Author:
Dr. Donald Doherty, Madhavi Gunda, Peter Spillman

Constructor Summary
RCXMath()
           
 
Method Summary
static java.lang.String byteArrayToString(byte[] b)
          converts a byte array into a String in hexidecimal form.
static java.lang.String byteToString(byte b)
          given a byte, return a String like: "09" or "AA" etc..
static byte getLowByte(int integer)
          gets the low byte of an int
static byte getSecondLowByte(int integer)
          gets the second low byte of an int
static byte stringToByte(java.lang.String s)
          given a String like: "09" or "AA" etc, return the relevant byte.
static byte[] stringToByteArray(java.lang.String bstr)
          converts a hexidecimal form of String to a byte array.
static byte toByte(java.lang.String string)
          converts a string to a byte.
static int toInt(java.lang.String string)
          converts a string to a int.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RCXMath

public RCXMath()
Method Detail

toByte

public static byte toByte(java.lang.String string)
converts a string to a byte.

Parameters:
string - the String to be converted to byte.
Returns:
the byte representing the string.

stringToByte

public static byte stringToByte(java.lang.String s)
given a String like: "09" or "AA" etc, return the relevant byte.

Parameters:
s - String of byte in hexadecimal format
Returns:
byte value of hexadecimal-string

byteToString

public static java.lang.String byteToString(byte b)
given a byte, return a String like: "09" or "AA" etc..

Parameters:
b - byte to turn to a String
Returns:
String of byte in hexadecimal format

toInt

public static int toInt(java.lang.String string)
converts a string to a int.

Parameters:
string - the String to be converted to an int.
Returns:
the int representing the string.

getLowByte

public static byte getLowByte(int integer)
gets the low byte of an int

Parameters:
integer - the int whose low byte is required.
Returns:
b the low byte of the int.

getSecondLowByte

public static byte getSecondLowByte(int integer)
gets the second low byte of an int

Parameters:
integer - the int whose second low byte is required.
Returns:
b the second low byte of the int.

byteArrayToString

public static java.lang.String byteArrayToString(byte[] b)
converts a byte array into a String in hexidecimal form.

Parameters:
b - byte[] to turn to a String
Returns:
String of bytes in hexadecimal format

stringToByteArray

public static byte[] stringToByteArray(java.lang.String bstr)
converts a hexidecimal form of String to a byte array.

Parameters:
bstr - String of bytes in hexadecimal format
Returns:
byte[] values of hexadecimal-string