com.ibm.bidiTools.bdlayout
Class ArabicOptionSet

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

public class ArabicOptionSet
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
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
 boolean equals(ArabicOptionSet other)
          Compares two ArabicOptionSets.
 ArabicOption getLamAlefMode()
          Returns the Lam Alef option from an ArabicOptionSet.
 ArabicOption getSeenMode()
          Returns the Seen option from an ArabicOptionSet.
 ArabicOption getTashkeelMode()
          Returns the Tashkeel option from an ArabicOptionSet.
 ArabicOption getYehHamzaMode()
          Returns the Yeh Hamza option from an ArabicOptionSet.
 int hashCode()
          Returns a hashcode for an ArabicOptionSet.
 void setAllOptions(ArabicOptionSet set)
          Sets all Arabic options based on another ArabicOptionSet.
 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
equals, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArabicOptionSet

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


ArabicOptionSet

public ArabicOptionSet(ArabicOptionSet set)
Constructs an ArabicOptionSet based on an existing ArabicOptionSet.

Parameters:
set - The ArabicOptionSet which is copied.

ArabicOptionSet

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

public ArabicOptionSet(ArabicOption option1,
                       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

public ArabicOptionSet(ArabicOption option1,
                       ArabicOption option2,
                       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

public ArabicOptionSet(ArabicOption option1,
                       ArabicOption option2,
                       ArabicOption option3,
                       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

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:

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

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

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

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

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

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

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

public void setAllOptions(ArabicOptionSet set)
Sets all Arabic options based on another ArabicOptionSet.

Parameters:
set - The ArabicOptionSet which is copied.

setOneOption

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.