Java Doc for ArabicShaping.java in  » Internationalization-Localization » icu4j » com » ibm » icu » text » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Internationalization Localization » icu4j » com.ibm.icu.text 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.ibm.icu.text.ArabicShaping

ArabicShaping
final public class ArabicShaping (Code)
Shape Arabic text on a character basis.

ArabicShaping performs basic operations for "shaping" Arabic text. It is most useful for use with legacy data formats and legacy display technology (simple terminals). All operations are performed on Unicode characters.

Text-based shaping means that some character code points in the text are replaced by others depending on the context. It transforms one kind of text into another. In comparison, modern displays for Arabic text select appropriate, context-dependent font glyphs for each text element, which means that they transform text into a glyph vector.

Text transformations are necessary when modern display technology is not available or when text needs to be transformed to or from legacy formats that use "shaped" characters. Since the Arabic script is cursive, connecting adjacent letters to each other, computers select images for each letter based on the surrounding letters. This usually results in four images per Arabic letter: initial, middle, final, and isolated forms. In Unicode, on the other hand, letters are normally stored abstract, and a display system is expected to select the necessary glyphs. (This makes searching and other text processing easier because the same letter has only one code.) It is possible to mimic this with text transformations because there are characters in Unicode that are rendered as letters with a specific shape (or cursive connectivity). They were included for interoperability with legacy systems and codepages, and for unsophisticated display systems.

A second kind of text transformations is supported for Arabic digits: For compatibility with legacy codepages that only include European digits, it is possible to replace one set of digits by another, changing the character code points. These operations can be performed for either Arabic-Indic Digits (U+0660...U+0669) or Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).

Some replacements may result in more or fewer characters (code points). By default, this means that the destination buffer may receive text with a length different from the source length. Some legacy systems rely on the length of the text to be constant. They expect extra spaces to be added or consumed either next to the affected character or at the end of the text.



Field Summary
final public static  intDIGITS_AN2EN
     Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...U+0039).
final public static  intDIGITS_EN2AN
     Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits.
final public static  intDIGITS_EN2AN_INIT_AL
     Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits if the most recent strongly directional character is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC).
final public static  intDIGITS_EN2AN_INIT_LR
     Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits if the most recent strongly directional character is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC).
final public static  intDIGITS_MASK
     Bit mask for digit shaping options.
final public static  intDIGITS_NOOP
     Digit shaping option: do not perform digit shaping.
final public static  intDIGIT_TYPE_AN
     Digit type option: Use Arabic-Indic digits (U+0660...U+0669).
final public static  intDIGIT_TYPE_AN_EXTENDED
     Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).
final public static  intDIGIT_TYPE_MASK
     Bit mask for digit type options.
final public static  intLENGTH_FIXED_SPACES_AT_BEGINNING
     Memory option: the result must have the same length as the source.
final public static  intLENGTH_FIXED_SPACES_AT_END
     Memory option: the result must have the same length as the source.
final public static  intLENGTH_FIXED_SPACES_NEAR
     Memory option: the result must have the same length as the source.
final public static  intLENGTH_GROW_SHRINK
     Memory option: allow the result to have a different length than the source.
final public static  intLENGTH_MASK
     Bit mask for memory options.
final public static  intLETTERS_MASK
     Bit mask for letter shaping options.
final public static  intLETTERS_NOOP
     Letter shaping option: do not perform letter shaping.
final public static  intLETTERS_SHAPE
     Letter shaping option: replace normative letter characters in the U+0600 (Arabic) block, by shaped ones in the U+FE70 (Presentation Forms B) block.
final public static  intLETTERS_SHAPE_TASHKEEL_ISOLATED
     Letter shaping option: replace normative letter characters in the U+0600 (Arabic) block, except for the TASHKEEL characters at U+064B...U+0652, by shaped ones in the U+Fe70 (Presentation Forms B) block.
final public static  intLETTERS_UNSHAPE
     Letter shaping option: replace shaped letter characters in the U+FE70 (Presentation Forms B) block by normative ones in the U+0600 (Arabic) block.
final public static  intTEXT_DIRECTION_LOGICAL
     Direction indicator: the source is in logical (keyboard) order.
final public static  intTEXT_DIRECTION_MASK
     Bit mask for direction indicators.
final public static  intTEXT_DIRECTION_VISUAL_LTR
     Direction indicator: the source is in visual (display) order, that is, the leftmost displayed character is stored first.

Constructor Summary
public  ArabicShaping(int options)
     Construct ArabicShaping using the options flags.

Method Summary
public  booleanequals(Object rhs)
    
public  inthashCode()
    
public  intshape(char[] source, int sourceStart, int sourceLength, char[] dest, int destStart, int destSize)
     Convert a range of text in the source array, putting the result into a range of text in the destination array, and return the number of characters written.
Parameters:
  source - An array containing the input text
Parameters:
  sourceStart - The start of the range of text to convert
Parameters:
  sourceLength - The length of the range of text to convert
Parameters:
  dest - The destination array that will receive the result.It may be NULL only if destSize is 0.
public  voidshape(char[] source, int start, int length)
     Convert a range of text in place.
public  Stringshape(String text)
     Convert a string, returning the new string.
public  StringtoString()
    

Field Detail
DIGITS_AN2EN
final public static int DIGITS_AN2EN(Code)
Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...U+0039).



DIGITS_EN2AN
final public static int DIGITS_EN2AN(Code)
Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits.



DIGITS_EN2AN_INIT_AL
final public static int DIGITS_EN2AN_INIT_AL(Code)
Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits if the most recent strongly directional character is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC). The initial state at the start of the text is assumed to be an Arabic, letter, so European digits at the start of the text will change. Compare to DIGITS_ALEN2AN_INT_LR.



DIGITS_EN2AN_INIT_LR
final public static int DIGITS_EN2AN_INIT_LR(Code)
Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits if the most recent strongly directional character is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC). The initial state at the start of the text is assumed to be not an Arabic, letter, so European digits at the start of the text will not change. Compare to DIGITS_ALEN2AN_INIT_AL.



DIGITS_MASK
final public static int DIGITS_MASK(Code)
Bit mask for digit shaping options.



DIGITS_NOOP
final public static int DIGITS_NOOP(Code)
Digit shaping option: do not perform digit shaping.



DIGIT_TYPE_AN
final public static int DIGIT_TYPE_AN(Code)
Digit type option: Use Arabic-Indic digits (U+0660...U+0669).



DIGIT_TYPE_AN_EXTENDED
final public static int DIGIT_TYPE_AN_EXTENDED(Code)
Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).



DIGIT_TYPE_MASK
final public static int DIGIT_TYPE_MASK(Code)
Bit mask for digit type options.



LENGTH_FIXED_SPACES_AT_BEGINNING
final public static int LENGTH_FIXED_SPACES_AT_BEGINNING(Code)
Memory option: the result must have the same length as the source. If more room is necessary, then try to consume spaces at the beginning of the text.



LENGTH_FIXED_SPACES_AT_END
final public static int LENGTH_FIXED_SPACES_AT_END(Code)
Memory option: the result must have the same length as the source. If more room is necessary, then try to consume spaces at the end of the text.



LENGTH_FIXED_SPACES_NEAR
final public static int LENGTH_FIXED_SPACES_NEAR(Code)
Memory option: the result must have the same length as the source. If more room is necessary, then try to consume spaces next to modified characters.



LENGTH_GROW_SHRINK
final public static int LENGTH_GROW_SHRINK(Code)
Memory option: allow the result to have a different length than the source.



LENGTH_MASK
final public static int LENGTH_MASK(Code)
Bit mask for memory options.



LETTERS_MASK
final public static int LETTERS_MASK(Code)
Bit mask for letter shaping options.



LETTERS_NOOP
final public static int LETTERS_NOOP(Code)
Letter shaping option: do not perform letter shaping.



LETTERS_SHAPE
final public static int LETTERS_SHAPE(Code)
Letter shaping option: replace normative letter characters in the U+0600 (Arabic) block, by shaped ones in the U+FE70 (Presentation Forms B) block. Performs Lam-Alef ligature substitution.



LETTERS_SHAPE_TASHKEEL_ISOLATED
final public static int LETTERS_SHAPE_TASHKEEL_ISOLATED(Code)
Letter shaping option: replace normative letter characters in the U+0600 (Arabic) block, except for the TASHKEEL characters at U+064B...U+0652, by shaped ones in the U+Fe70 (Presentation Forms B) block. The TASHKEEL characters will always be converted to the isolated forms rather than to their correct shape.



LETTERS_UNSHAPE
final public static int LETTERS_UNSHAPE(Code)
Letter shaping option: replace shaped letter characters in the U+FE70 (Presentation Forms B) block by normative ones in the U+0600 (Arabic) block. Converts Lam-Alef ligatures to pairs of Lam and Alef characters, consuming spaces if required.



TEXT_DIRECTION_LOGICAL
final public static int TEXT_DIRECTION_LOGICAL(Code)
Direction indicator: the source is in logical (keyboard) order.



TEXT_DIRECTION_MASK
final public static int TEXT_DIRECTION_MASK(Code)
Bit mask for direction indicators.



TEXT_DIRECTION_VISUAL_LTR
final public static int TEXT_DIRECTION_VISUAL_LTR(Code)
Direction indicator: the source is in visual (display) order, that is, the leftmost displayed character is stored first.




Constructor Detail
ArabicShaping
public ArabicShaping(int options)(Code)
Construct ArabicShaping using the options flags. The flags are as follows:
'LENGTH' flags control whether the text can change size, and if not, how to maintain the size of the text when LamAlef ligatures are formed or broken.
'TEXT_DIRECTION' flags control whether the text is read and written in visual order or in logical order.
'LETTERS_SHAPE' flags control whether conversion is to or from presentation forms.
'DIGITS' flags control whether digits are shaped, and whether from European to Arabic-Indic or vice-versa.
'DIGIT_TYPE' flags control whether standard or extended Arabic-Indic digits are used when performing digit conversion.




Method Detail
equals
public boolean equals(Object rhs)(Code)



hashCode
public int hashCode()(Code)



shape
public int shape(char[] source, int sourceStart, int sourceLength, char[] dest, int destStart, int destSize) throws ArabicShapingException(Code)
Convert a range of text in the source array, putting the result into a range of text in the destination array, and return the number of characters written.
Parameters:
  source - An array containing the input text
Parameters:
  sourceStart - The start of the range of text to convert
Parameters:
  sourceLength - The length of the range of text to convert
Parameters:
  dest - The destination array that will receive the result.It may be NULL only if destSize is 0.
Parameters:
  destStart - The start of the range of the destination buffer to use.
Parameters:
  destSize - The size (capacity) of the destination buffer.If destSize is 0, then no output is produced,but the necessary buffer size is returned ("preflighting"). Thisdoes not validate the text against the options, for example, if letters are being unshaped, and spaces are being consumedfollowing lamalef, this will not detect a lamalef without a corresponding space. An error will be thrown when the actualconversion is attempted. The number of chars written to the destination buffer.If an error occurs, then no output was written, or it may beincomplete.
throws:
  ArabicShapingException - if the text cannot be converted according to the options.



shape
public void shape(char[] source, int start, int length) throws ArabicShapingException(Code)
Convert a range of text in place. This may only be used if the Length option does not grow or shrink the text.
Parameters:
  source - An array containing the input text
Parameters:
  start - The start of the range of text to convert
Parameters:
  length - The length of the range of text to convert
throws:
  ArabicShapingException - if the text cannot be converted according to the options.



shape
public String shape(String text) throws ArabicShapingException(Code)
Convert a string, returning the new string.
Parameters:
  text - the string to convert the converted string
throws:
  ArabicShapingException - if the string cannot be converted according to the options.



toString
public String toString()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.