Java Doc for Bidi.java in  » Apache-Harmony-Java-SE » java-package » java » 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 » Apache Harmony Java SE » java package » java.text 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.text.Bidi

Bidi
final public class Bidi (Code)
Bidi is the class providing the bidirectional algorithm. The algorithm is defined in the Unicode Standard Annex #9, version 13, also described in The Unicode Standard, Version 4.0 . Use a Bidi object to get the information on the position reordering of a bidirectional text, such as Arabic or Hebrew. The natural display ordering of horizontal text in these languages is from right to left, while they order numbers from left to right. If the text contains multiple runs, the information of each run can be obtained from the run index. The level of any particular run indicates the direction of the text as well as the nesting level. Left-to-right runs have even levels while right-to-left runs have odd levels.


Field Summary
final public static  intDIRECTION_DEFAULT_LEFT_TO_RIGHT
     Constant that indicates the default base level.
final public static  intDIRECTION_DEFAULT_RIGHT_TO_LEFT
     Constant that indicates the default base level.
final public static  intDIRECTION_LEFT_TO_RIGHT
     Constant that specifies the default base level as left-to-right.
final public static  intDIRECTION_RIGHT_TO_LEFT
     Constant that specifies the default base level right-to-left.

Constructor Summary
public  Bidi(AttributedCharacterIterator paragraph)
     Create a Bidi object from the AttributedCharacterIterator of a paragraph text. The RUN_DIRECTION attribute determines the base direction of the bidirectional text.
public  Bidi(char[] text, int textStart, byte[] embeddings, int embStart, int paragraphLength, int flags)
     Create a Bidi object.
Parameters:
  text - the char array of the paragraph text.
Parameters:
  textStart - the start offset of the text array to perform the algorithm.
Parameters:
  embeddings - the embedding level array of the paragraph text, specifyingthe embedding level information for each character.
public  Bidi(String paragraph, int flags)
     Create a Bidi object.
Parameters:
  paragraph - the String containing the paragraph text to perform thealgorithm.
Parameters:
  flags - indicates the base direction of the bidirectional text.

Method Summary
public  booleanbaseIsLeftToRight()
     Return whether the base level is from left to right.
public  BidicreateLineBidi(int lineStart, int lineLimit)
     Create a new Bidi object containing the information of one line from this object.
Parameters:
  lineStart - the start offset of the line.
Parameters:
  lineLimit - the limit of the line.
public  intgetBaseLevel()
     Return the base level.
public  intgetLength()
     Return the length of the text in the Bidi object.
public  intgetLevelAt(int offset)
     Return the level of a specified character.
Parameters:
  offset - the offset of the character.
public  intgetRunCount()
     Return the number of runs in the bidirectional text.
public  intgetRunLevel(int run)
     Return the level of a specified run.
Parameters:
  run - the index of the run.
public  intgetRunLimit(int run)
     Return the limit offset of a specified run.
Parameters:
  run - the index of the run.
public  intgetRunStart(int run)
     Return the start offset of a specified run.
Parameters:
  run - the index of the run.
public  booleanisLeftToRight()
     Return whether the text is from left to right, that is, both the base direction and the text direction is from left to right.
public  booleanisMixed()
     Return whether the text direction is mixed.
public  booleanisRightToLeft()
     Return whether the text is from right to left, that is, both the base direction and the text direction is from right to left.
public static  voidreorderVisually(byte[] levels, int levelStart, Object[] objects, int objectStart, int count)
     Reorder a range of objects according to their specified levels.
public static  booleanrequiresBidi(char[] text, int start, int limit)
     Return whether a range of characters of a text requires a Bidi object to display properly.
Parameters:
  text - the char array of the text.
Parameters:
  start - the start offset of the range of characters.
Parameters:
  limit - the limit offset of the range of characters.
public  StringtoString()
     Return the internal message of the Bidi object, used in debugging.

Field Detail
DIRECTION_DEFAULT_LEFT_TO_RIGHT
final public static int DIRECTION_DEFAULT_LEFT_TO_RIGHT(Code)
Constant that indicates the default base level. If there is no strong character, then set the paragraph level to left-to-right.



DIRECTION_DEFAULT_RIGHT_TO_LEFT
final public static int DIRECTION_DEFAULT_RIGHT_TO_LEFT(Code)
Constant that indicates the default base level. If there is no strong character, then set the paragraph level to right-to-left.



DIRECTION_LEFT_TO_RIGHT
final public static int DIRECTION_LEFT_TO_RIGHT(Code)
Constant that specifies the default base level as left-to-right.



DIRECTION_RIGHT_TO_LEFT
final public static int DIRECTION_RIGHT_TO_LEFT(Code)
Constant that specifies the default base level right-to-left.




Constructor Detail
Bidi
public Bidi(AttributedCharacterIterator paragraph)(Code)
Create a Bidi object from the AttributedCharacterIterator of a paragraph text. The RUN_DIRECTION attribute determines the base direction of the bidirectional text. If it's not specified explicitly, the algorithm uses DIRECTION_DEFAULT_LEFT_TO_RIGHT by default. The BIDI_EMBEDDING attribute specifies the level of embedding for each character. Values between -1 and -62 denote overrides at the level's absolute value, values from 1 to 62 indicate embeddings, and the 0 value indicates the level is calculated by the algorithm automatically. For the character with no BIDI_EMBEDDING attribute or with a improper attribute value, such as a null value, the algorithm treats its embedding level as 0. The NUMERIC_SHAPING attribute specifies the instance of NumericShaper used to convert European digits to other decimal digits before performing the bidi algorithm.
Parameters:
  paragraph -
See Also:   java.awt.font.TextAttribute.BIDI_EMBEDDING
See Also:   java.awt.font.TextAttribute.NUMERIC_SHAPING
See Also:   java.awt.font.TextAttribute.RUN_DIRECTION



Bidi
public Bidi(char[] text, int textStart, byte[] embeddings, int embStart, int paragraphLength, int flags)(Code)
Create a Bidi object.
Parameters:
  text - the char array of the paragraph text.
Parameters:
  textStart - the start offset of the text array to perform the algorithm.
Parameters:
  embeddings - the embedding level array of the paragraph text, specifyingthe embedding level information for each character. Valuesbetween -1 and -62 denote overrides at the level's absolutevalue, values from 1 to 62 indicate embeddings, and the 0value indicates the level is calculated by the algorithmautomatically.
Parameters:
  embStart - the start offset of the embeddings array to perform thealgorithm.
Parameters:
  paragraphLength - the length of the text to perform the algorithm. It must betext.length >= textStart + paragraphLength, andembeddings.length >= embStart + paragraphLength.
Parameters:
  flags - indicates the base direction of the bidirectional text. It isexpected that this will be one of the direction constantvalues defined in this class. An unknown value is treated asDIRECTION_DEFAULT_LEFT_TO_RIGHT.
See Also:   Bidi.DIRECTION_LEFT_TO_RIGHT
See Also:   Bidi.DIRECTION_RIGHT_TO_LEFT
See Also:   Bidi.DIRECTION_DEFAULT_RIGHT_TO_LEFT
See Also:   Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT



Bidi
public Bidi(String paragraph, int flags)(Code)
Create a Bidi object.
Parameters:
  paragraph - the String containing the paragraph text to perform thealgorithm.
Parameters:
  flags - indicates the base direction of the bidirectional text. It isexpected that this will be one of the direction constantvalues defined in this class. An unknown value is treated asDIRECTION_DEFAULT_LEFT_TO_RIGHT.
See Also:   Bidi.DIRECTION_LEFT_TO_RIGHT
See Also:   Bidi.DIRECTION_RIGHT_TO_LEFT
See Also:   Bidi.DIRECTION_DEFAULT_RIGHT_TO_LEFT
See Also:   Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT




Method Detail
baseIsLeftToRight
public boolean baseIsLeftToRight()(Code)
Return whether the base level is from left to right. true if the base level is from left to right.



createLineBidi
public Bidi createLineBidi(int lineStart, int lineLimit)(Code)
Create a new Bidi object containing the information of one line from this object.
Parameters:
  lineStart - the start offset of the line.
Parameters:
  lineLimit - the limit of the line. the new line Bidi object. In this new object, the indices willrange from 0 to (limit - start - 1).



getBaseLevel
public int getBaseLevel()(Code)
Return the base level. the int value of the base level.



getLength
public int getLength()(Code)
Return the length of the text in the Bidi object. the int value of the length.



getLevelAt
public int getLevelAt(int offset)(Code)
Return the level of a specified character.
Parameters:
  offset - the offset of the character. the int value of the level.



getRunCount
public int getRunCount()(Code)
Return the number of runs in the bidirectional text. the int value of runs, at least 1.



getRunLevel
public int getRunLevel(int run)(Code)
Return the level of a specified run.
Parameters:
  run - the index of the run. the level of the run.



getRunLimit
public int getRunLimit(int run)(Code)
Return the limit offset of a specified run.
Parameters:
  run - the index of the run. the limit offset of the run.



getRunStart
public int getRunStart(int run)(Code)
Return the start offset of a specified run.
Parameters:
  run - the index of the run. the start offset of the run.



isLeftToRight
public boolean isLeftToRight()(Code)
Return whether the text is from left to right, that is, both the base direction and the text direction is from left to right. true if the text is from left to right.



isMixed
public boolean isMixed()(Code)
Return whether the text direction is mixed. true if the text direction is mixed.



isRightToLeft
public boolean isRightToLeft()(Code)
Return whether the text is from right to left, that is, both the base direction and the text direction is from right to left. true if the text is from right to left.



reorderVisually
public static void reorderVisually(byte[] levels, int levelStart, Object[] objects, int objectStart, int count)(Code)
Reorder a range of objects according to their specified levels. This is a convenience function that does not use a Bidi object. The range of objects at index from objectStart to objectStart + count will be reordered according to the range of levels at index from levelStart to levelStart + count.
Parameters:
  levels - the level array, which is already determined.
Parameters:
  levelStart - the start offset of the range of the levels.
Parameters:
  objects - the object array to reorder.
Parameters:
  objectStart - the start offset of the range of objects.
Parameters:
  count - the count of the range of objects to reorder.



requiresBidi
public static boolean requiresBidi(char[] text, int start, int limit)(Code)
Return whether a range of characters of a text requires a Bidi object to display properly.
Parameters:
  text - the char array of the text.
Parameters:
  start - the start offset of the range of characters.
Parameters:
  limit - the limit offset of the range of characters. true if the range of characters requires a Bidi object.



toString
public String toString()(Code)
Return the internal message of the Bidi object, used in debugging. a string containing the internal message.



Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) 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.