wyvern.util
Class StringUtils

java.lang.Object
  extended bywyvern.util.StringUtils

public final class StringUtils
extends java.lang.Object

JDK 1.4-compatible String utilities class.

Version:
1.0, Jun 05, 2003
Author:
Steve Yegge

Method Summary
static java.lang.String concat(java.util.List lines)
          Prints a list of lines to a StringBuffer.
static void main(java.lang.String[] args)
          Testing functions.
static java.util.ArrayList readLines(java.lang.String path)
          Reads a text file into a list of lines.
static int[] splitDate(java.lang.String date)
          Splits a date in the format "MM/DD/YYYY" or "MM-DD-YYYY" into an array of 3 ints (m, d, y).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

splitDate

public static int[] splitDate(java.lang.String date)
Splits a date in the format "MM/DD/YYYY" or "MM-DD-YYYY" into an array of 3 ints (m, d, y). Example: "3/10/2002" => {3, 10, 2002}

Parameters:
date - a date string
Returns:
an int array. element 0 is month, 1 is day of month, and 2 is year.
Throws:
java.lang.IllegalArgumentException - if the date format is invalid

concat

public static java.lang.String concat(java.util.List lines)
Prints a list of lines to a StringBuffer. Preserves line breaks.


readLines

public static java.util.ArrayList readLines(java.lang.String path)
Reads a text file into a list of lines.

Parameters:
path - the absolute path to the file
Returns:
the contents as a list, or null if there was an error

main

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