com.ibm.bidiTools.bdlayout
Class BidiTransform

java.lang.Object
  extended by com.ibm.bidiTools.bdlayout.BidiTransform

public class BidiTransform
extends java.lang.Object

The BidiTransform class defines Text Layout transformations.

Layout transformations allow converting a given instance of BidiText (the source) into another instance (the destination) with possibly different Bidi flags while conserving the semantics of the text.

Bidi text is a combination of a sequence of characters and a set of Bidi flags. Bidi text is implemented by the BidiText class.

A BidiTransform instance contains fields which define what auxiliary outputs are required from the transformation, and fields to refer to these outputs. The work itself is done by the transform method of the BidiText class.

Boolean fields are used to specify options of the transform operation. Other fields are used to store auxiliary outputs of the transformation.

There are no specific constructors for this class. The default constructor creates a default BidiFlagSet and puts its reference in the "flags" instance member. Unless modified later, this qualifies a transformation to Implicit LTR swapped numerals-nominal unshaped text.

Multi-threading considerations: each thread must use its own instances of this class.


Field Summary
 boolean continuation
          Option: this invocation is a continuation from the previous one (re-establish same conditions as at the end of last call)
 boolean destinationRequired
          Option: create a destination BidiText If this flag is not true, the transform method will return a null.
 int[] dstToSrcMap
          Output value: destination-to-source map from the last transform with dstToSrcMapRequired specified; if this option was not specified, the content of dstToSrcMap should be ignored.
 boolean dstToSrcMapRequired
          Option: create a destination to source mapping
 BidiFlagSet flags
          Option: Bidi flags of destination BidiText
 int inpCount
          Output value: number of characters processed in the source data by the last transform
 ArabicOptionSet options
          Option: shaping options for this transformation
 int outCount
          Output value: number of characters written in the destination data by the last transform
 byte[] propertyMap
          Output value: property map from the last transform with propertyMapRequired specified; if this option was not specified, the content of propertyMap should be ignored.
 boolean propertyMapRequired
          Option: create a property map
 boolean roundTrip
          Option: use "roundtrip" algorithm for reordering
 int[] srcToDstMap
          Output value: source-to-destination map from the last transform with srcToDstMapRequired specified; if this option was not specified, the content of srcToDstMap should be ignored.
 boolean srcToDstMapRequired
          Option: create a source to destination mapping
 boolean wordBreak
          Option: consider white space to always follow base orientation
 
Method Summary
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flags

public BidiFlagSet flags
Option: Bidi flags of destination BidiText


roundTrip

public boolean roundTrip
Option: use "roundtrip" algorithm for reordering


options

public ArabicOptionSet options
Option: shaping options for this transformation


wordBreak

public boolean wordBreak
Option: consider white space to always follow base orientation


destinationRequired

public boolean destinationRequired
Option: create a destination BidiText

If this flag is not true, the transform method will return a null.


srcToDstMapRequired

public boolean srcToDstMapRequired
Option: create a source to destination mapping


dstToSrcMapRequired

public boolean dstToSrcMapRequired
Option: create a destination to source mapping


propertyMapRequired

public boolean propertyMapRequired
Option: create a property map


continuation

public boolean continuation
Option: this invocation is a continuation from the previous one (re-establish same conditions as at the end of last call)


inpCount

public int inpCount
Output value: number of characters processed in the source data by the last transform


outCount

public int outCount
Output value: number of characters written in the destination data by the last transform


srcToDstMap

public int[] srcToDstMap
Output value: source-to-destination map from the last transform with srcToDstMapRequired specified; if this option was not specified, the content of srcToDstMap should be ignored.

If when starting a transformation this field refers to a large enough array of integers, this array will be re-used to put the new map. Otherwise a new array will be created.

This map has a number for each character processed in the source data by the last transform. This number is the index of where this character is moved in the character array of the destination BidiText.

Note that the allocated array may have more elements than the number of characters processed in the source BidiText. In that case, the extra elements should be ignored. The number of relevant elements can be found in inpCount.


dstToSrcMap

public int[] dstToSrcMap
Output value: destination-to-source map from the last transform with dstToSrcMapRequired specified; if this option was not specified, the content of dstToSrcMap should be ignored.

If when starting a transformation this field refers to a large enough array of integers, this array will be re-used to put the new map. Otherwise a new array will be created.

This map has a number for each character in the "interesting" data of the destination BidiText. This number is the index of the source character from which the destination character originates. This index is relative to the beginning of the "interesting" data. If the offset of the source BidiText is not zero, index 0 does not indicate the first character of the data array, but the character at position "offset".

Note that the allocated array may have more elements than the number of characters in the "interesting" part of the destination BidiText. In that case, the extra elements should be ignored. The number of relevant elements can be found in outCount.


propertyMap

public byte[] propertyMap
Output value: property map from the last transform with propertyMapRequired specified; if this option was not specified, the content of propertyMap should be ignored.

If when starting a transformation this field refers to a large enough array of bytes, this array will be re-used to put the new map. Otherwise a new array will be created.

This map has a byte for each character processed in the source data by the last transform. The 6 lower bits of each property element is the Bidi level of the corresponding input character. The highest bit is a new-cell indicator for composed character environments: a value of 0 indicates a zero-length composing character element, and a value of 1 indicates an element that begins a new cell.

Note also that the allocated array may have more elements than the number of characters processed in the source BidiText. In that case, the extra elements should be ignored. The number of relevant elements can be found in inpCount.