be.SIRAPRISE.util
Class FixedLengthFormatter

java.lang.Object
  extended by be.SIRAPRISE.util.FixedLengthFormatter

public final class FixedLengthFormatter
extends java.lang.Object

Author:
Erwin

Method Summary
static java.lang.String appendBlanks(int length, java.lang.String buffer)
          Appends blanks to a String such that the string length becomes equal to a given length
static void appendBlanks(int length, java.lang.StringBuffer buffer)
           
static void appendZeroes(int length, java.lang.StringBuffer buffer)
           
static java.lang.String prependBlanks(int length, java.lang.String buffer)
          Prepends a specified number of blanks to a String
static java.lang.String prependZeroes(int length, java.lang.String buffer)
           
static void prependZeroes(int length, java.lang.StringBuffer buffer)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

prependBlanks

public static java.lang.String prependBlanks(int length,
                                             java.lang.String buffer)
Prepends a specified number of blanks to a String

Parameters:
length - The number of blanks to prepend
buffer - The buffer where blanks have to be prepended
Returns:
the input string padded with blanks

appendBlanks

public static java.lang.String appendBlanks(int length,
                                            java.lang.String buffer)
Appends blanks to a String such that the string length becomes equal to a given length

Parameters:
length - The length that the string has to become
buffer - The string value to which blanks have to be appended
Returns:
the input string padded with blanks

appendBlanks

public static void appendBlanks(int length,
                                java.lang.StringBuffer buffer)
Parameters:
length -
buffer -

prependZeroes

public static java.lang.String prependZeroes(int length,
                                             java.lang.String buffer)
Parameters:
length - the total length that the number must have after formatting
buffer - the number to be formatted
Returns:
the input string prepended with zeroes

prependZeroes

public static void prependZeroes(int length,
                                 java.lang.StringBuffer buffer)
Parameters:
length - the total length that the number must have after formatting
buffer - the number to be formatted

appendZeroes

public static void appendZeroes(int length,
                                java.lang.StringBuffer buffer)
Parameters:
length - the total length that the number must have after formatting
buffer - the number to be formatted