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

TransliteratorIDParser
class TransliteratorIDParser (Code)
Parsing component for transliterator IDs. This class contains only static members; it cannot be instantiated. Methods in this class parse various ID formats, including the following: A basic ID, which contains source, target, and variant, but no filter and no explicit inverse. Examples include "Latin-Greek/UNGEGN" and "Null". A single ID, which is a basic ID plus optional filter and optional explicit inverse. Examples include "[a-zA-Z] Latin-Greek" and "Lower (Upper)". A compound ID, which is a sequence of one or more single IDs, separated by semicolons, with optional forward and reverse global filters. The global filters are UnicodeSet patterns prepended or appended to the IDs, separated by semicolons. An appended filter must be enclosed in parentheses and applies in the reverse direction.
author:
   Alan Liu

Inner Class :static class SingleID



Method Summary
public static  String[]IDtoSTV(String id)
     Parse an ID into pieces.
public static  StringSTVtoID(String source, String target, String variant)
     Given source, target, and variant strings, concatenate them into a full ID.
public static  voidinstantiateList(Vector list)
     Convert the elements of the 'list' vector, which are SingleID objects, into actual Transliterator objects.
public static  booleanparseCompoundID(String id, int dir, StringBuffer canonID, Vector list, UnicodeSet[] globalFilter)
     Parse a compound ID, consisting of an optional forward global filter, a separator, one or more single IDs delimited by separators, an an optional reverse global filter.
public static  SingleIDparseFilterID(String id, int[] pos)
     Parse a filter ID, that is, an ID of the general form "[f1] s1-t1/v1", with the filters optional, and the variants optional.
Parameters:
  id - the id to be parsed
Parameters:
  pos - INPUT-OUTPUT parameter.
public static  UnicodeSetparseGlobalFilter(String id, int[] pos, int dir, int[] withParens, StringBuffer canonID)
     Parse a global filter of the form "[f]" or "([f])", depending on 'withParens'.
Parameters:
  id - the pattern the parse
Parameters:
  pos - INPUT-OUTPUT parameter.
public static  SingleIDparseSingleID(String id, int[] pos, int dir)
     Parse a single ID, that is, an ID of the general form "[f1] s1-t1/v1 ([f2] s2-t3/v2)", with the parenthesized element optional, the filters optional, and the variants optional.
Parameters:
  id - the id to be parsed
Parameters:
  pos - INPUT-OUTPUT parameter.
public static  voidregisterSpecialInverse(String target, String inverseTarget, boolean bidirectional)
     Register two targets as being inverses of one another.



Method Detail
IDtoSTV
public static String[] IDtoSTV(String id)(Code)
Parse an ID into pieces. Take IDs of the form T, T/V, S-T, S-T/V, or S/V-T. If the source is missing, return a source of ANY.
Parameters:
  id - the id string, in any of several forms an array of 4 strings: source, target, variant, andisSourcePresent. If the source is not present, ANY will begiven as the source, and isSourcePresent will be null. OtherwiseisSourcePresent will be non-null. The target may be empty if theid is not well-formed. The variant may be empty.



STVtoID
public static String STVtoID(String source, String target, String variant)(Code)
Given source, target, and variant strings, concatenate them into a full ID. If the source is empty, then "Any" will be used for the source, so the ID will always be of the form s-t/v or s-t.



instantiateList
public static void instantiateList(Vector list)(Code)
Convert the elements of the 'list' vector, which are SingleID objects, into actual Transliterator objects. In the course of this, some (or all) entries may be removed. If all entries are removed, the Null transliterator will be added. Delete entries with empty basicIDs; these are generated by elements like "(A)" in the forward direction, or "A()" in the reverse. THIS MAY RESULT IN AN EMPTY VECTOR. Convert SingleID entries to actual transliterators.
Parameters:
  list - vector of SingleID objects. On exit, vectorof one or more Transliterators.



parseCompoundID
public static boolean parseCompoundID(String id, int dir, StringBuffer canonID, Vector list, UnicodeSet[] globalFilter)(Code)
Parse a compound ID, consisting of an optional forward global filter, a separator, one or more single IDs delimited by separators, an an optional reverse global filter. The separator is a semicolon. The global filters are UnicodeSet patterns. The reverse global filter must be enclosed in parentheses.
Parameters:
  id - the pattern the parse
Parameters:
  dir - the direction.
Parameters:
  canonID - OUTPUT parameter that receives the canonical ID,consisting of canonical IDs for all elements, as returned byparseSingleID(), separated by semicolons. Previous contentsare discarded.
Parameters:
  list - OUTPUT parameter that receives a list of SingleIDobjects representing the parsed IDs. Previous contents arediscarded.
Parameters:
  globalFilter - OUTPUT parameter that receives a pointer toa newly created global filter for this ID in this direction, ornull if there is none. true if the parse succeeds, that is, if the entireid is consumed without syntax error.



parseFilterID
public static SingleID parseFilterID(String id, int[] pos)(Code)
Parse a filter ID, that is, an ID of the general form "[f1] s1-t1/v1", with the filters optional, and the variants optional.
Parameters:
  id - the id to be parsed
Parameters:
  pos - INPUT-OUTPUT parameter. On input, the position ofthe first character to parse. On output, the position afterthe last character parsed. a SingleID object or null if the parse fails



parseGlobalFilter
public static UnicodeSet parseGlobalFilter(String id, int[] pos, int dir, int[] withParens, StringBuffer canonID)(Code)
Parse a global filter of the form "[f]" or "([f])", depending on 'withParens'.
Parameters:
  id - the pattern the parse
Parameters:
  pos - INPUT-OUTPUT parameter. On input, the position ofthe first character to parse. On output, the position afterthe last character parsed.
Parameters:
  dir - the direction.
Parameters:
  withParens - INPUT-OUTPUT parameter. On entry, ifwithParens[0] is 0, then parens are disallowed. If it is 1,then parens are requires. If it is -1, then parens areoptional, and the return result will be set to 0 or 1.
Parameters:
  canonID - OUTPUT parameter. The pattern for the filteradded to the canonID, either at the end, if dir is FORWARD, orat the start, if dir is REVERSE. The pattern will be enclosedin parentheses if appropriate, and will be suffixed with anID_DELIM character. May be null. a UnicodeSet object or null. A non-null resultsindicates a successful parse, regardless of whether the filterapplies to the given direction. The caller should discard itif withParens != (dir == REVERSE).



parseSingleID
public static SingleID parseSingleID(String id, int[] pos, int dir)(Code)
Parse a single ID, that is, an ID of the general form "[f1] s1-t1/v1 ([f2] s2-t3/v2)", with the parenthesized element optional, the filters optional, and the variants optional.
Parameters:
  id - the id to be parsed
Parameters:
  pos - INPUT-OUTPUT parameter. On input, the position ofthe first character to parse. On output, the position afterthe last character parsed.
Parameters:
  dir - the direction. If the direction is REVERSE then theSingleID is constructed for the reverse direction. a SingleID object or null



registerSpecialInverse
public static void registerSpecialInverse(String target, String inverseTarget, boolean bidirectional)(Code)
Register two targets as being inverses of one another. For example, calling registerSpecialInverse("NFC", "NFD", true) causes Transliterator to form the following inverse relationships:
NFC => NFD
 Any-NFC => Any-NFD
 NFD => NFC
 Any-NFD => Any-NFC
(Without the special inverse registration, the inverse of NFC would be NFC-Any.) Note that NFD is shorthand for Any-NFD, but that the presence or absence of "Any-" is preserved.

The relationship is symmetrical; registering (a, b) is equivalent to registering (b, a).

The relevant IDs must still be registered separately as factories or classes.

Only the targets are specified. Special inverses always have the form Any-Target1 <=> Any-Target2. The target should have canonical casing (the casing desired to be produced when an inverse is formed) and should contain no whitespace or other extraneous characters.
Parameters:
  target - the target against which to register the inverse
Parameters:
  inverseTarget - the inverse of target, that isAny-target.getInverse() => Any-inverseTarget
Parameters:
  bidirectional - if true, register the reverse relationas well, that is, Any-inverseTarget.getInverse() => Any-target




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.