com.ibm.bidiTools.bdlayout

Class BidiConvert

  1. java.lang.Object
  2. extended bycom.ibm.bidiTools.bdlayout.BidiConvert

  1. public class BidiConvert
  2. extends java.lang.Object
BidiConvert is a convenience class to facilitate invocation of the Bidi layout transformations by converter code in the JVM.

It contains 2 public methods: toUnicode() and toSbcs().

Method toUnicode() must be called by the ByteToChar converters after converting the SBCS byte data into Unicode.

Method toSbcs() must be called by the CharToByte converters before converting the Unicode string data into byte data.


Constructor Summary

Constructor and Description
BidiConvert()

Method Summary

Modifier and Type Method and Description
  1. boolean
isBidiData(char[] input,int inStart,int inEnd,java.lang.String bidiParms,java.lang.String encoding)
This method checks if a char array needs Bidi transformation.
  1. boolean
isBidiData(java.nio.CharBuffer input,boolean UseBuffer,java.lang.String bidiParms,java.lang.String encoding)
This method checks if a CharBuffer needs Bidi transformation.
  1. boolean
isBidiData(java.lang.String input,java.lang.String bidiParms,java.lang.String encoding)
This method checks if a string needs Bidi transformation.
  1. boolean
isBidiEnv(java.lang.String bidiParms,java.lang.String encoding)
This method checks if the environment allows Bidi transformations for the current encoding.
  1. char[]
toSbcs(char[] input,int inStart,int inEnd,java.lang.String bidiParms,java.lang.String encoding)
This method converts a char array from the Bidi attributes used inside the JVM to those used outside the JVM.
  1. java.nio.CharBuffer
toSbcs(java.nio.CharBuffer input,boolean UseBuffer,java.lang.String bidiParms,java.lang.String encoding)
This method converts a CharBuffer from the Bidi attributes used inside the JVM to those used outside the JVM.
  1. java.lang.String
toSbcs(java.lang.String input,java.lang.String bidiParms,java.lang.String encoding)
This method converts a string from the Bidi attributes used inside the JVM to those used outside the JVM.
  1. char[]
toUnicode(char[] input,int inStart,int inEnd,java.lang.String bidiParms,java.lang.String encoding)
This method converts a char array from the Bidi attributes used outside the JVM to those used inside the JVM.
  1. java.nio.CharBuffer
toUnicode(java.nio.CharBuffer input,boolean UseBuffer,java.lang.String bidiParms,java.lang.String encoding)
This method converts a CharBuffer from the Bidi attributes used outside the JVM to those used inside the JVM.
  1. java.lang.String
toUnicode(java.lang.String input,java.lang.String bidiParms,java.lang.String encoding)
This method converts a string from the Bidi attributes used outside the JVM to those used inside the JVM.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

BidiConvert

  1. public BidiConvert()

Method Detail

isBidiEnv

  1. public boolean isBidiEnv(java.lang.String bidiParms,
  2. java.lang.String encoding)
This method checks if the environment allows Bidi transformations for the current encoding.
Parameters:
bidiParms - The environment variable containing the specifications of the Bidi attributes.
encoding - The encoding of the data outside the JVM.
Returns:
true if the environment allows Bidi transformations for the current encoding.

isBidiData

  1. public boolean isBidiData(char[] input,
  2. int inStart,
  3. int inEnd,
  4. java.lang.String bidiParms,
  5. java.lang.String encoding)
This method checks if a char array needs Bidi transformation.
Parameters:
input - The input char array containing text in Unicode.
inStart - Offset in input array.
inEnd - Offset of last byte to be converted.
bidiParms - The environment variable containing the specifications of the Bidi attributes.
encoding - The encoding of the data outside the JVM.
Returns:
true if the string needs Bidi transformation.

isBidiData

  1. public boolean isBidiData(java.lang.String input,
  2. java.lang.String bidiParms,
  3. java.lang.String encoding)
This method checks if a string needs Bidi transformation.
Parameters:
input - The input string.
bidiParms - The environment variable containing the specifications of the Bidi attributes.
encoding - The encoding of the data outside the JVM.
Returns:
true if the string needs Bidi transformation.

isBidiData

  1. public boolean isBidiData(java.nio.CharBuffer input,
  2. boolean UseBuffer,
  3. java.lang.String bidiParms,
  4. java.lang.String encoding)
This method checks if a CharBuffer needs Bidi transformation.
Parameters:
input - The input buffer.
UseBuffer - flag to prevent use of char array in CharBuffer.
bidiParms - The environment variable containing the specifications of the Bidi attributes.
encoding - The encoding of the data outside the JVM.
Returns:
true if the buffer needs Bidi transformation.

toUnicode

  1. public char[] toUnicode(char[] input,
  2. int inStart,
  3. int inEnd,
  4. java.lang.String bidiParms,
  5. java.lang.String encoding)
This method converts a char array from the Bidi attributes used outside the JVM to those used inside the JVM.
Parameters:
input - The input char array.
inStart - Offset in input array.
inEnd - Offset of last byte to be converted.
bidiParms - The environment variable containing the specifications of the Bidi attributes.
encoding - The encoding of the data outside the JVM.
Returns:
The input char array transformed to the layout specified by bidiParms.

toUnicode

  1. public java.lang.String toUnicode( java.lang.String input,
  2. java.lang.String bidiParms,
  3. java.lang.String encoding)
This method converts a string from the Bidi attributes used outside the JVM to those used inside the JVM.
Parameters:
input - The input string.
bidiParms - The environment variable containing the specifications of the Bidi attributes.
encoding - The encoding of the data outside the JVM.
Returns:
The input string transformed to the layout specified by bidiParms.

toUnicode

  1. public java.nio.CharBuffer toUnicode( java.nio.CharBuffer input,
  2. boolean UseBuffer,
  3. java.lang.String bidiParms,
  4. java.lang.String encoding)
This method converts a CharBuffer from the Bidi attributes used outside the JVM to those used inside the JVM.
Parameters:
input - The input buffer.
UseBuffer - flag to prevent use of char array in CharBuffer.
bidiParms - The environment variable containing the specifications of the Bidi attributes.
encoding - The encoding of the data outside the JVM.
Returns:
another CharBuffer with its data input string transformed to the layout specified by bidiParms.

toSbcs

  1. public char[] toSbcs(char[] input,
  2. int inStart,
  3. int inEnd,
  4. java.lang.String bidiParms,
  5. java.lang.String encoding)
This method converts a char array from the Bidi attributes used inside the JVM to those used outside the JVM.
Parameters:
input - The input char array.
inStart - Offset in input array.
inEnd - Offset of last byte to be converted.
bidiParms - The environment variable containing the specifications of the Bidi attributes.
encoding - The encoding of the data outside the JVM.
Returns:
The input char array transformed to the layout specified by bidiParms.

toSbcs

  1. public java.lang.String toSbcs( java.lang.String input,
  2. java.lang.String bidiParms,
  3. java.lang.String encoding)
This method converts a string from the Bidi attributes used inside the JVM to those used outside the JVM.
Parameters:
input - The input string.
bidiParms - The environment variable containing the specifications of the Bidi attributes.
encoding - The encoding of the data outside the JVM.
Returns:
The input string transformed to the layout specified by bidiParms.

toSbcs

  1. public java.nio.CharBuffer toSbcs( java.nio.CharBuffer input,
  2. boolean UseBuffer,
  3. java.lang.String bidiParms,
  4. java.lang.String encoding)
This method converts a CharBuffer from the Bidi attributes used inside the JVM to those used outside the JVM.
Parameters:
input - The input buffer.
UseBuffer - flag to prevent use of char array in CharBuffer.
bidiParms - The environment variable containing the specifications of the Bidi attributes.
encoding - The encoding of the data outside the JVM.
Returns:
another CharBuffer with its data input string transformed to the layout specified by bidiParms.