com.taco.text
Class StringPadder

java.lang.Object
  extended by com.taco.text.StringPadder

public class StringPadder
extends java.lang.Object

A utility class for padding strings to fit a certain field width.


Constructor Summary
protected StringPadder()
           
 
Method Summary
static char[] padAlignLeft(java.lang.CharSequence cs, int n)
          Return a char array of length n, that has up to n characters of the character sequence, padded with spaces on the left if necessary.
static char[] padAlignLeft(java.lang.CharSequence cs, int n, char padChar)
          Return a char array of length n, that has up to n characters of the character sequence, padded with instances of padChar on the left if necessary
static char[] padAlignRight(java.lang.CharSequence cs, int n)
          Return a char array of length n, that has up to n characters of the character sequence, padded with spaces on the right if necessary.
static char[] padAlignRight(java.lang.CharSequence cs, int n, char padChar)
          Return a char array of length n, that has up to n characters of the character sequence, padded with instances of padChar on the right if necessary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringPadder

protected StringPadder()
Method Detail

padAlignLeft

public static final char[] padAlignLeft(java.lang.CharSequence cs,
                                        int n)
Return a char array of length n, that has up to n characters of the character sequence, padded with spaces on the left if necessary.


padAlignLeft

public static final char[] padAlignLeft(java.lang.CharSequence cs,
                                        int n,
                                        char padChar)
Return a char array of length n, that has up to n characters of the character sequence, padded with instances of padChar on the left if necessary


padAlignRight

public static final char[] padAlignRight(java.lang.CharSequence cs,
                                         int n)
Return a char array of length n, that has up to n characters of the character sequence, padded with spaces on the right if necessary.


padAlignRight

public static final char[] padAlignRight(java.lang.CharSequence cs,
                                         int n,
                                         char padChar)
Return a char array of length n, that has up to n characters of the character sequence, padded with instances of padChar on the right if necessary