com.theorem.ftp
Class Text

java.lang.Object
  |
  +--com.theorem.ftp.Text

public class Text
extends java.lang.Object

Some text methods.


Constructor Summary
Text()
           
 
Method Summary
static void dumpStack()
          Dump out the current call stack to stdout.
static java.lang.String format(int n, int width)
          Format a number to the given width, right justfied, blank filled.
static java.lang.String format(long n, int width)
          Format a number to the given width, right justfied, blank filled.
static java.lang.String replace(java.lang.String s, java.lang.String a, java.lang.String b)
          Replace all occurences of a with b.
static java.lang.String[] split(java.lang.String s)
          Split a line into an array based on white space.
static java.lang.String[] split(java.lang.String s, java.lang.String delim)
          Split a line into an array based on the delimiter.
static java.lang.String toHexString(byte[] buf)
          Convert a byte buffer to a hex string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Text

public Text()
Method Detail

replace

public static java.lang.String replace(java.lang.String s,
                                       java.lang.String a,
                                       java.lang.String b)
Replace all occurences of a with b.
Parameters:
s - original string.
a - string to change.
b - replacement string.
Returns:
string with replacements.

split

public static java.lang.String[] split(java.lang.String s)
Split a line into an array based on white space.
Parameters:
s - String to split
Returns:
array of strings.

split

public static java.lang.String[] split(java.lang.String s,
                                       java.lang.String delim)
Split a line into an array based on the delimiter.
Parameters:
s - String to split
delim - list of delimiters
Returns:
array of strings.

toHexString

public static java.lang.String toHexString(byte[] buf)
Convert a byte buffer to a hex string.
Parameters:
buf - Byte array.
Returns:
Hexadecimal representation.

dumpStack

public static void dumpStack()
Dump out the current call stack to stdout.

format

public static java.lang.String format(int n,
                                      int width)
Format a number to the given width, right justfied, blank filled.
Parameters:
n - Number to format.
width - Width of spaces + number.
Returns:
formatted number.

format

public static java.lang.String format(long n,
                                      int width)
Format a number to the given width, right justfied, blank filled.
Parameters:
n - Number to format.
width - Width of spaces + number.
Returns:
formatted number.