org.aitools.programd.util
Class StringKit

java.lang.Object
  extended by org.aitools.programd.util.StringKit

public class StringKit
extends java.lang.Object

Contains various utilities.

Author:
Richard Wallace, Jon Baer, Thomas Ringate, Pedro Colla, Noel Bush

Field Summary
private static java.lang.String EMPTY_STRING
          An empty string.
private static java.lang.String LINE_SEPARATOR
          The system line separator.
 
Constructor Summary
StringKit()
           
 
Method Summary
static java.lang.String renderAsLines(java.lang.String[] strings)
          Turns an array of strings into a single string with line separators between each of the original strings.
static java.lang.String tab(int level)
          Returns a tab of the specified length.
static java.util.ArrayList<java.lang.String> wordSplit(java.lang.String input)
          Splits an input into words, breaking at spaces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_STRING

private static final java.lang.String EMPTY_STRING
An empty string.

See Also:
Constant Field Values

LINE_SEPARATOR

private static final java.lang.String LINE_SEPARATOR
The system line separator.

Constructor Detail

StringKit

public StringKit()
Method Detail

tab

public static java.lang.String tab(int level)
Returns a tab of the specified length.

Parameters:
level - the level of the tab
Returns:
the requested tab

wordSplit

public static java.util.ArrayList<java.lang.String> wordSplit(java.lang.String input)
Splits an input into words, breaking at spaces. This method is obviously limited in that it is not aware of other word boundaries.

Parameters:
input - the input to split
Returns:
the input split into sentences

renderAsLines

public static java.lang.String renderAsLines(java.lang.String[] strings)
Turns an array of strings into a single string with line separators between each of the original strings.

Parameters:
strings - the strings to render
Returns:
the rendered strings