com.ibm.bidiTools.bdlayout

Class ArabicOptionSet

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

  1. public class ArabicOptionSet
  2. extends java.lang.Object
This class represents an ArabicOptionSet object defining the shaping attributes to be used during Bidi Layout Transformation process. It also defines the available values for each option.

Arabic text has some special characters that can be converted to different formats, which are characterized by four Bidi options, these options are stored in four Arabic objects. These four options constitute an ArabicOptionSet.

An ArabicOptionSet object contains a value for each of the four Arabic objects which represent the Arabic options. The four options are:

The Arabic options values are pre-defined in this class. Each one represents one possible value of one Arabic option.

For more information on Arabic Shaping options, see: Bidirectional support in IBM SDK: A user guide

Multi-threading considerations: There are no multi-threading concerns for this class, since it only defines static final instances.


Constructor Summary

Constructor and Description
ArabicOptionSet()
Constructs an ArabicOptionSet with the default value.
ArabicOptionSet(ArabicOption option)
Constructs an ArabicOptionSet from one ArabicOption.
ArabicOptionSet(ArabicOption option1,ArabicOption option2)
Constructs an ArabicOptionSet from two ArabicOptions.
ArabicOptionSet(ArabicOption option1,ArabicOption option2,ArabicOption option3)
Constructs an ArabicOptionSet from three ArabicOptions.
ArabicOptionSet(ArabicOption option1,ArabicOption option2,ArabicOption option3,ArabicOption option4)
Constructs an ArabicOptionSet from four ArabicOptions.
ArabicOptionSet(ArabicOptionSet set)
Constructs an ArabicOptionSet based on an existing ArabicOptionSet.
ArabicOptionSet(char[] chars)
Constructs an ArabicOptionSet from a char array.

Method Summary

Modifier and Type Method and Description
  1. boolean
equals(ArabicOptionSet other)
Compares two ArabicOptionSets.
  1. ArabicOption
getLamAlefMode()
Returns the Lam Alef option from an ArabicOptionSet.
  1. ArabicOption
getSeenMode()
Returns the Seen option from an ArabicOptionSet.
  1. ArabicOption
getTashkeelMode()
Returns the Tashkeel option from an ArabicOptionSet.
  1. ArabicOption
getYehHamzaMode()
Returns the Yeh Hamza option from an ArabicOptionSet.
  1. int
hashCode()
Returns a hashcode for an ArabicOptionSet.
  1. void
setAllOptions(ArabicOptionSet set)
Sets all Arabic options based on another ArabicOptionSet.
  1. void
setOneOption(ArabicOption newoption)
Sets a new value for one of the Bidi Options in a set without changing the other Arabic Options.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ArabicOptionSet

  1. public ArabicOptionSet()
Constructs an ArabicOptionSet with the default value. The default is:
  Auto for all options
  

ArabicOptionSet

  1. public ArabicOptionSet(ArabicOptionSet set)
Constructs an ArabicOptionSet based on an existing ArabicOptionSet.
Parameters:
set - The ArabicOptionSet which is copied.

ArabicOptionSet

  1. public ArabicOptionSet(ArabicOption option)
Constructs an ArabicOptionSet from one ArabicOption. The other Arabic Options are set to their default.

Example:

  ArabicOptionset bdOpts = new ArabicOptionSet(LAMALEF_NEAR);
  
Parameters:
option - The ArabicOption which is explicitly specified.

ArabicOptionSet

  1. public ArabicOptionSet(ArabicOption option1,
  2. ArabicOption option2)
Constructs an ArabicOptionSet from two ArabicOptions. The other Arabic options are set to their default.

Example:

  ArabicOptionset bdOpts = new ArabicOptionSet(LAMALEF_NEAR, SEEN_NEAR);
  
Parameters:
option1 - The first ArabicOption which is explicitly specified.
option2 - The second ArabicOption which is explicitly specified.
Throws:
java.lang.IllegalArgumentException - If the arguments conflict or are duplicates.

ArabicOptionSet

  1. public ArabicOptionSet(ArabicOption option1,
  2. ArabicOption option2,
  3. ArabicOption option3)
Constructs an ArabicOptionSet from three ArabicOptions. The other Arabic option is set to its default.

Example:

  ArabicOptionset bdOpts = new ArabicOptionSet(LAMALEF_NEAR, SEEN_NEAR, YEHHAMZA_TWO_CELL_NEAR);
  
Parameters:
option1 - The first ArabicOption which is explicitly specified.
option2 - The second ArabicOption which is explicitly specified.
option3 - The third ArabicOption which is explicitly specified.
Throws:
java.lang.IllegalArgumentException - If the arguments conflict or are duplicates.

ArabicOptionSet

  1. public ArabicOptionSet(ArabicOption option1,
  2. ArabicOption option2,
  3. ArabicOption option3,
  4. ArabicOption option4)
Constructs an ArabicOptionSet from four ArabicOptions.
Parameters:
option1 - The first ArabicOption which is explicitly specified.
option2 - The second ArabicOption which is explicitly specified.
option3 - The third ArabicOption which is explicitly specified.
option4 - The fourth ArabicOption which is explicitly specified.
Throws:
java.lang.IllegalArgumentException - If the arguments conflict or are duplicates.

ArabicOptionSet

  1. public ArabicOptionSet(char[] chars)
Constructs an ArabicOptionSet from a char array. The content of the array must follow the specification for the "S" and "U parts of the BIDI environment variable, as follows:
  • character 1: type of text = I (Implicit) or V (Visual)
  • character 2: orientation = L (LTR), R (RTL), C (Contextual LTR) or D (Contextual RTL)
  • character 3: swapping = Y (Swapping ON) or N (Swapping OFF)
  • character 4: text shaping = N (Nominal), S (Shaped), I (Initial), M (Middle), F (Final) or B (Isolated)
  • character 5: numeral shaping = N (Nominal), H (National) or C (Contextual)
  • character 6: bidi algorithm = U (Unicode) or R (Roundtrip)
  • character 7: Lamalef mode = N (Near), B (At Begin), E (At End) or A (Auto)
  • character 8: SeenTail mode = N (Near) or A (Auto)
  • character 9: Yeh Hamza mode = N (Near) or A (Auto)
  • character 10:Tashkeel mode = K (Keep), B (Customized at Begin), E (Customized at End) or A (Auto)

Only characters 7 to 10 are used to build the ArabicOptionSet.

Parameters:
chars - character array in Convert parms format. It contains the output options specified in the Bidi environment variable

Method Detail

equals

  1. public boolean equals(ArabicOptionSet other)
Compares two ArabicOptionSets. Two ArabicOptionSets are considered equal if they represent the same values for the four Arabic options.
Parameters:
other - The ArabicOptionSet to compare to this.
Returns:
true if the ArabicOptionSets are equal, false otherwise.

getLamAlefMode

  1. public ArabicOption getLamAlefMode( )
Returns the Lam Alef option from an ArabicOptionSet.
Returns:
The value of the Lam Alef option.

The expected value is one of LAMALEF_NEAR, LAMALEF_ATBEGIN, LAMALEF_ATEND or LAMALEF_AUTO


getSeenMode

  1. public ArabicOption getSeenMode( )
Returns the Seen option from an ArabicOptionSet.
Returns:
The value of the Seen option.

The expected value is one of SEEN_NEAR or SEEN_AUTO.


getYehHamzaMode

  1. public ArabicOption getYehHamzaMode( )
Returns the Yeh Hamza option from an ArabicOptionSet.
Returns:
The value of the Yeh Hamza option.

The expected value is one of YEHHAMZA_TWO_CELL_NEAR or YEHHAMZA_AUTO.


getTashkeelMode

  1. public ArabicOption getTashkeelMode( )
Returns the Tashkeel option from an ArabicOptionSet.
Returns:
The value of the Tashkeel option.

The expected value is one of TASHKEEL_KEEP, TASHKEEL_CUSTOMIZED_ATBEGIN, TASHKEEL_CUSTOMIZED_ATEND or TASHKEEL_AUTO.


hashCode

  1. public int hashCode()
Returns a hashcode for an ArabicOptionSet. The hashcode of a ArabicOptionSet is the same as the hashcode of its value.
Overrides:
hashCode in class java.lang.Object
Returns:
A hashcode value.

setAllOptions

  1. public void setAllOptions(ArabicOptionSet set)
Sets all Arabic options based on another ArabicOptionSet.
Parameters:
set - The ArabicOptionSet which is copied.

setOneOption

  1. public void setOneOption(ArabicOption newoption)
Sets a new value for one of the Bidi Options in a set without changing the other Arabic Options.

The new value must be one of the pre-defined values for ArabicOption.

Parameters:
newoption - The new value requested for one of the options.