edu.stanford.hci.r3.util
Class StringUtils

java.lang.Object
  extended by edu.stanford.hci.r3.util.StringUtils

public class StringUtils
extends java.lang.Object

Manipulate and analyze Strings.

This software is distributed under the BSD License.


Constructor Summary
StringUtils()
           
 
Method Summary
static java.awt.Dimension getStringSize(java.lang.String textToMeasure, java.awt.Font displayFont)
          Measures the size of the input string, taking into account the current font and newlines.
static java.lang.String repeat(java.lang.String string, int numTimes)
           
static java.util.List<java.lang.String> splitString(java.lang.String string, int maxCharsPerLine)
          Splits a string into multiple lines, each with at most maxChars characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtils

public StringUtils()
Method Detail

getStringSize

public static java.awt.Dimension getStringSize(java.lang.String textToMeasure,
                                               java.awt.Font displayFont)
Measures the size of the input string, taking into account the current font and newlines.

Returns:

repeat

public static java.lang.String repeat(java.lang.String string,
                                      int numTimes)
Parameters:
string -
numTimes -
Returns:
stringstringstringstring.... numTimes over.

splitString

public static java.util.List<java.lang.String> splitString(java.lang.String string,
                                                           int maxCharsPerLine)
Splits a string into multiple lines, each with at most maxChars characters. We will try our best to split after spaces.

Parameters:
string -
maxCharsPerLine -
Returns:
a List of Strings representing the lines.

Copyright 2006 Stanford University