edu.cmu.minorthird.util
Class StringUtil

java.lang.Object
  extended by edu.cmu.minorthird.util.StringUtil

public class StringUtil
extends java.lang.Object

String utilities.


Constructor Summary
StringUtil()
           
 
Method Summary
static double atof(java.lang.String doubleName)
          Convert a string to a double.
static int atoi(java.lang.String intName)
          Convert a string to an integer.
static java.lang.String indent(int tabs, java.lang.String s)
          Indent a string
static java.lang.String lineWrap(java.lang.String s, int lineLength)
          Line-wrap a string
static void main(java.lang.String[] args)
           
static java.lang.String toString(double[] x)
          Convert an array to a string.
static java.lang.String toString(double[] x, java.lang.String prefix, java.lang.String suffix, java.lang.String sep)
          Convert an array of doubles to a string.
static java.lang.String toString(int[] x)
          Convert an array to a string.
static java.lang.String toString(int[] x, java.lang.String prefix, java.lang.String suffix, java.lang.String sep)
          Convert an array of ints to a string.
static java.lang.String toString(java.lang.Object[] x)
          Convert an array to a string.
static java.lang.String toString(java.lang.Object[] x, java.lang.String prefix, java.lang.String suffix, java.lang.String sep)
           
static java.lang.String truncate(int len, java.lang.String s)
          Truncate a string to fixed length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtil

public StringUtil()
Method Detail

lineWrap

public static java.lang.String lineWrap(java.lang.String s,
                                        int lineLength)
Line-wrap a string


indent

public static java.lang.String indent(int tabs,
                                      java.lang.String s)
Indent a string


toString

public static java.lang.String toString(java.lang.Object[] x)
Convert an array to a string.


toString

public static java.lang.String toString(double[] x)
Convert an array to a string.


toString

public static java.lang.String toString(int[] x)
Convert an array to a string.


toString

public static java.lang.String toString(java.lang.Object[] x,
                                        java.lang.String prefix,
                                        java.lang.String suffix,
                                        java.lang.String sep)

toString

public static java.lang.String toString(double[] x,
                                        java.lang.String prefix,
                                        java.lang.String suffix,
                                        java.lang.String sep)
Convert an array of doubles to a string.


toString

public static java.lang.String toString(int[] x,
                                        java.lang.String prefix,
                                        java.lang.String suffix,
                                        java.lang.String sep)
Convert an array of ints to a string.


atoi

public static int atoi(java.lang.String intName)
Convert a string to an integer. Throws an IllegalArgumentException if the string is not a legal integer.


atof

public static double atof(java.lang.String doubleName)
Convert a string to a double. Throws an IllegalArgumentException if the string is not a legal double.


truncate

public static java.lang.String truncate(int len,
                                        java.lang.String s)
Truncate a string to fixed length.


main

public static void main(java.lang.String[] args)