Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.util
Class NlsString

java.lang.Object
  extended by com.ibm.etools.iseries.util.NlsString

public class NlsString
extends Object

A simple facade to a set of operations on strings that considers all national language encodings


Field Summary
static String copyright
           
 
Constructor Summary
NlsString()
           
 
Method Summary
static int getEbcdicLength(String strText, int ccsid)
          Return the length in EBCBIC bytes of this Unicode String
static int getEbcdicLength(String strText, int ccsid, boolean isPureDbcs)
          Return the length in EBCBIC bytes of this Unicode String
static int getEbcdicLengthWithEmbeddedShifts(String strText, int ccsid)
          If a Unicode string already has shift characters embedded what is its length in EBCDIC bytes.
static String pad(String strText, int targetLength, char c, int ccsid)
          Pad this Unicode string to the desired length in EBCDIC bytes with the given character
static String substring(String string, int start, int end, int ccsid)
          Return the Unicode substring of the given Unicode string given the EBCDIC byte offsets
static String truncate(String strText, int targetLength, int ccsid, boolean isPureDbcs)
          Truncate this Unicode string to the desired length in EBCDIC bytes If it is too short, return as is
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values
Constructor Detail

NlsString

public NlsString()
Method Detail

getEbcdicLength

public static int getEbcdicLength(String strText,
                                  int ccsid)
Return the length in EBCBIC bytes of this Unicode String


getEbcdicLength

public static int getEbcdicLength(String strText,
                                  int ccsid,
                                  boolean isPureDbcs)
Return the length in EBCBIC bytes of this Unicode String


getEbcdicLengthWithEmbeddedShifts

public static int getEbcdicLengthWithEmbeddedShifts(String strText,
                                                    int ccsid)
If a Unicode string already has shift characters embedded what is its length in EBCDIC bytes. We still need to consider that DBCS characters are double width and that lam + alef is only 1 character.

Returns:

pad

public static String pad(String strText,
                         int targetLength,
                         char c,
                         int ccsid)
Pad this Unicode string to the desired length in EBCDIC bytes with the given character


truncate

public static String truncate(String strText,
                              int targetLength,
                              int ccsid,
                              boolean isPureDbcs)
Truncate this Unicode string to the desired length in EBCDIC bytes If it is too short, return as is


substring

public static String substring(String string,
                               int start,
                               int end,
                               int ccsid)
Return the Unicode substring of the given Unicode string given the EBCDIC byte offsets


Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.