Java Doc for CollationElementIterator.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.CollationElementIterator

CollationElementIterator
final public class CollationElementIterator (Code)

CollationElementIterator is created by a RuleBasedCollator to iterate through a string. The return result of each iteration is a 32-bit collation element that defines the ordering priority of the next character or sequence of characters in the source string.

For illustration, consider the following in Spanish:

"ca" -> the first collation element is collation_element('c') and second collation element is collation_element('a').

Since "ch" in Spanish sorts as one entity, the below example returns one collation element for the two characters 'c' and 'h'

"cha" -> the first collation element is collation_element('ch') and second collation element is collation_element('a').

And in German,

Since the character '\u0086' is a composed character of 'a' and 'e', the iterator returns two collation elements for the single character '\u0086'

"\u0086b" -> the first collation element is collation_element('a'), the second collation element is collation_element('e'), and the third collation element is collation_element('b').



Field Summary
final public static  intNULLORDER
     This constant is returned by the iterator in the methods next() and previous() when the end or the beginning of the source string has been reached, and there are no more valid collation elements to return.

Constructor Summary
 CollationElementIterator(com.ibm.icu.text.CollationElementIterator iterator)
    

Method Summary
public  intgetMaxExpansion(int order)
     Obtains the maximum length of any expansion sequence that ends with the specified collation element.
public  intgetOffset()
     Obtains the character offset in the source string corresponding to the next collation element.
public  intnext()
     Obtains the next collation element in the source string.
public  intprevious()
     Obtains the previous collation element in the source string.
final public static  intprimaryOrder(int order)
     Obtains the primary order of the specified collation element, i.e.
public  voidreset()
     Repositions the cursor to point at the first element of the current string.
final public static  shortsecondaryOrder(int order)
     Obtains the secondary order of the specified collation element, i.e.
public  voidsetOffset(int newOffset)
     Points the iterator at the collation element associated with the character in the source string which is found at the supplied offset. After this call completes, an invocation of the CollationElementIterator.next() method will return this collation element.

If newOffset corresponds to a character which is part of a sequence that maps to a single collation element the iterator is adjusted to the start of that sequence.

public  voidsetText(CharacterIterator source)
     Sets a new source string iterator for iteration, and reset the offset to the beginning of the text.
public  voidsetText(String source)
     Sets a new source string for iteration, and reset the offset to the beginning of the text.
final public static  shorttertiaryOrder(int order)
     Obtains the tertiary order of the specified collation element, i.e.

Field Detail
NULLORDER
final public static int NULLORDER(Code)
This constant is returned by the iterator in the methods next() and previous() when the end or the beginning of the source string has been reached, and there are no more valid collation elements to return.




Constructor Detail
CollationElementIterator
CollationElementIterator(com.ibm.icu.text.CollationElementIterator iterator)(Code)




Method Detail
getMaxExpansion
public int getMaxExpansion(int order)(Code)
Obtains the maximum length of any expansion sequence that ends with the specified collation element. If there is no expansion with this collation element as the last element, returns 1.
Parameters:
  order - a collation element that has been previously obtained from acall to either the CollationElementIterator.next() or CollationElementIterator.previous()method. the maximum length of any expansion sequence ending with thespecified collation element.



getOffset
public int getOffset()(Code)
Obtains the character offset in the source string corresponding to the next collation element. This value could be any of:
  • The index of the first character in the source string that matches the value of the next collation element. (This means that if setOffset(offset) sets the index in the middle of a contraction, getOffset() returns the index of the first character in the contraction, which may not be equal to the original offset that was set. Hence calling getOffset() immediately after setOffset(offset) does not guarantee that the original offset set will be returned.)
  • If normalization is on, the index of the immediate subsequent character, or composite character with the first character, having a combining class of 0.
  • The length of the source string, if iteration has reached the end.
  • The position of the collation element in the source string thatwill be returned in the next invocation of the CollationElementIterator.next()method.



    next
    public int next()(Code)
    Obtains the next collation element in the source string. the next collation element or NULLORDER if the endof the iteration has been reached.



    previous
    public int previous()(Code)
    Obtains the previous collation element in the source string. the previous collation element, or NULLORDER whenthe start of the iteration has been reached.



    primaryOrder
    final public static int primaryOrder(int order)(Code)
    Obtains the primary order of the specified collation element, i.e. the first 16 bits. This value is unsigned.
    Parameters:
      order - the element's 16 bits primary order.



    reset
    public void reset()(Code)
    Repositions the cursor to point at the first element of the current string. The next call to next() or previous() will return the first and last collation element in the string, respectively.

    If the RuleBasedCollator used by this iterator has had its attributes changed, calling reset() will reinitialize the iterator to use the new attributes.




    secondaryOrder
    final public static short secondaryOrder(int order)(Code)
    Obtains the secondary order of the specified collation element, i.e. the 16th to 23th bits, inclusive. This value is unsigned.
    Parameters:
      order - the 8 bit secondary order of the element



    setOffset
    public void setOffset(int newOffset)(Code)
    Points the iterator at the collation element associated with the character in the source string which is found at the supplied offset. After this call completes, an invocation of the CollationElementIterator.next() method will return this collation element.

    If newOffset corresponds to a character which is part of a sequence that maps to a single collation element the iterator is adjusted to the start of that sequence. As a result of this, any subsequent call made to getOffset() may not return the same value set by this method.

    If the decomposition mode is on, and offset is in the middle of a decomposable range of source text, the iterator may not return a correct result for the next forwards or backwards iteration. The user must ensure that the offset is not in the middle of a decomposable range.


    Parameters:
      newOffset - the character offset into the original source string to set.Note that this is not an offset into the correspondingsequence of collation elements.



    setText
    public void setText(CharacterIterator source)(Code)
    Sets a new source string iterator for iteration, and reset the offset to the beginning of the text.
    Parameters:
      source - the new source string iterator for iteration.



    setText
    public void setText(String source)(Code)
    Sets a new source string for iteration, and reset the offset to the beginning of the text.
    Parameters:
      source - the new source string for iteration



    tertiaryOrder
    final public static short tertiaryOrder(int order)(Code)
    Obtains the tertiary order of the specified collation element, i.e. the last 8 bits. This value is unsigned.
    Parameters:
      order - the 8 bits tertiary order of the element



    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.