edu.cmu.aura.service.util
Class TextUtil

java.lang.Object
  |
  +--edu.cmu.aura.service.util.TextUtil

public class TextUtil
extends java.lang.Object

TextUtil provides miscellaneous text related utilities.


Constructor Summary
TextUtil()
           
 
Method Summary
static java.lang.String getTabString(int numTabs)
          Create string consisting of a given number of tabs.
static java.lang.String pad(double num, int pad)
          Pad a number to fill a field size.
static java.lang.String pad(int num, int pad)
          Pad a number to fill a field size.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextUtil

public TextUtil()
Method Detail

getTabString

public static final java.lang.String getTabString(int numTabs)
Create string consisting of a given number of tabs.
Parameters:
numTabs - the number of tabs in the string to return.
Returns:
a string with the given number of tabs.

pad

public static java.lang.String pad(int num,
                                   int pad)
Pad a number to fill a field size. Leading zeros will be added to make the pad.
Parameters:
num - number to pad
pad - field size
Returns:
padded String form of num.

pad

public static java.lang.String pad(double num,
                                   int pad)
Pad a number to fill a field size. Leading zeros will be added to make the pad. The floating point part of the number is not counting for the padding. So, pad(7.2, 2) returns "07.2".
Parameters:
num - number to pad
pad - field size
Returns:
padded String form of num.