com.ibm.commerce.payment.utils

Class TextAlignHelper

  • java.lang.Object
    • com.ibm.commerce.payment.utils.TextAlignHelper


  • public class TextAlignHelper
    extends java.lang.Object
    Utility class with static methods for aligning text Strings.
    • Constructor Summary

      Constructors 
      Constructor and Description
      TextAlignHelper() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.String centerAlign(java.lang.String sIn, int iSize, java.lang.String sEncoding)
      Align a given Text String in the Center of a line of specified size.
      static java.lang.String leftAlign(java.lang.String sIn, int iSize, java.lang.String sEncoding)
      Align a given Text String to the left of a line of specified size.
      static java.lang.String rightAlign(java.lang.String sIn, int iSize, java.lang.String sEncoding)
      Align a given Text String to the right of a line of specified size.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TextAlignHelper

        public TextAlignHelper()
    • Method Detail

      • centerAlign

        public static java.lang.String centerAlign(java.lang.String sIn,
                                                   int iSize,
                                                   java.lang.String sEncoding)
                                            throws java.io.UnsupportedEncodingException
        Align a given Text String in the Center of a line of specified size.
        Parameters:
        sIn - The text String to be centered.
        iSize - The size of the line that is to contain the Text String.
        sEncoding - The encoding to be used for the output line.
        Returns:
        The new String with the given Text centered using the specified encoding.
        Throws:
        java.io.UnsupportedEncodingException
      • leftAlign

        public static java.lang.String leftAlign(java.lang.String sIn,
                                                 int iSize,
                                                 java.lang.String sEncoding)
                                          throws java.io.UnsupportedEncodingException
        Align a given Text String to the left of a line of specified size.
        Parameters:
        sIn - The text String to be left-aligned.
        iSize - The size of the line that is to contain the Text String.
        sEncoding - The encoding to be used for the output line.
        Returns:
        The new String with the given Text left-aligned using the specified encoding.
        Throws:
        java.io.UnsupportedEncodingException
      • rightAlign

        public static java.lang.String rightAlign(java.lang.String sIn,
                                                  int iSize,
                                                  java.lang.String sEncoding)
                                           throws java.io.UnsupportedEncodingException
        Align a given Text String to the right of a line of specified size.

        Parameters:
        sIn - The text String to be right-aligned.
        iSize - The size of the line that is to contain the Text String.
        sEncoding - The encoding to be used for the output line.
        Returns:
        The new String with the given Text right-aligned using the specified encoding.
        Throws:
        java.io.UnsupportedEncodingException