Source Code Cross Referenced for CharacterModel.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » rdf » arp » impl » 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 » RSS RDF » Jena 2.5.5 » com.hp.hpl.jena.rdf.arp.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
003:         * See end of file.
004:         */
005:
006:        package com.hp.hpl.jena.rdf.arp.impl;
007:
008:        import com.ibm.icu.lang.UCharacter;
009:        import com.ibm.icu.text.Normalizer;
010:
011:        /**
012:         * Some support for the Character Model Recommendation
013:         * from the W3C (currently in second last call working 
014:         * draft).
015:         * 
016:         * @author Jeremy Carroll
017:         *
018:         * 
019:         */
020:        public class CharacterModel {
021:            static private final boolean SWITCH_OFF = false;
022:
023:            /** Is this string in Unicode Normal Form C.
024:             * @param str The string to be tested.
025:             */
026:            static public boolean isNormalFormC(String str) {
027:                //	    try {
028:                return SWITCH_OFF
029:                        || Normalizer.isNormalized(str, Normalizer.NFC, 0);
030:                //	    }
031:                //	    catch (ArrayIndexOutOfBoundsException e) {
032:                //	        // false below means "NFC" see javadoc for compose().
033:                //	        String normalized = Normalizer.compose(str,false);
034:                //	        return normalized.equals(str);
035:                //	    }
036:            }
037:
038:            /* Does this string start with a composing character as defined
039:             * by the 
040:             * <a href="http://www.w3.org/TR/charmod">
041:             * Character Model 2nd Last Call Working Draft</a>.
042:             * @param str The string to be tested.
043:             */
044:            static public boolean startsWithComposingCharacter(String str) {
045:                return SWITCH_OFF ? false : (str.length() == 0 ? false
046:                        : isComposingChar(str.charAt(0)));
047:            }
048:
049:            /** Is this string fully normalized as defined
050:             * by the 
051:             * <a href="http://www.w3.org/TR/charmod">
052:             * Character Model 2nd Last Call Working Draft</a>.
053:             * @param str The string to be tested.
054:             */
055:            static public boolean isFullyNormalizedConstruct(String str) {
056:                return SWITCH_OFF
057:                        || (isNormalFormC(str) && !startsWithComposingCharacter(str));
058:            }
059:
060:            /** Is the character a composing character as defined
061:             * by the 
062:             * <a href="http://www.w3.org/TR/charmod">
063:             * Character Model 2nd Last Call Working Draft</a>.
064:             * @param x The character to be tested.
065:             */
066:            static public boolean isComposingChar(char x) {
067:                if (SWITCH_OFF)
068:                    return false;
069:                switch (x) {
070:                // Brahmi-derived scripts
071:                case 0X09BE: // BENGALI VOWEL SIGN AA 
072:                case 0X09D7: // BENGALI AU LENGTH MARK 
073:                case 0X0B3E: // ORIYA VOWEL SIGN AA 
074:                case 0X0B56: // ORIYA AI LENGTH MARK 
075:                case 0X0B57: // ORIYA AU LENGTH MARK 
076:                case 0X0BBE: // TAMIL VOWEL SIGN AA 
077:                case 0X0BD7: // TAMIL AU LENGTH MARK 
078:                case 0X0CC2: // KANNADA VOWEL SIGN UU 
079:                case 0X0CD5: // KANNADA LENGTH MARK 
080:                case 0X0CD6: // KANNADA AI LENGTH MARK 
081:                case 0X0D3E: // MALAYALAM VOWEL SIGN AA 
082:                case 0X0D57: // MALAYALAM AU LENGTH MARK 
083:                case 0X0DCF: // SINHALA VOWEL SIGN AELA-PILLA 
084:                case 0X0DDF: // SINHALA VOWEL SING GAYANUKITTA 
085:                case 0X0FB5: // TIBETAN SUBJOINED LETTER SSA 
086:                case 0X0FB7: // TIBETAN SUBJOINED LETTER HA 
087:                case 0X102E: // MYANMAR VOWEL SIGN II 
088:                // Hangul vowels 
089:                case 0X1161: // HANGUL JUNGSEONG A 
090:                case 0X1162: // HANGUL JUNGSEONG AE 
091:                case 0X1163: // HANGUL JUNGSEONG YA 
092:                case 0X1164: // HANGUL JUNGSEONG YAE 
093:                case 0X1165: // HANGUL JUNGSEONG EO 
094:                case 0X1166: // HANGUL JUNGSEONG E 
095:                case 0X1167: // HANGUL JUNGSEONG YEO 
096:                case 0X1168: // HANGUL JUNGSEONG YE 
097:                case 0X1169: // HANGUL JUNGSEONG O 
098:                case 0X116A: // HANGUL JUNGSEONG WA 
099:                case 0X116B: // HANGUL JUNGSEONG WAE 
100:                case 0X116C: // HANGUL JUNGSEONG OE 
101:                case 0X116D: // HANGUL JUNGSEONG YO 
102:                case 0X116E: // HANGUL JUNGSEONG U 
103:                case 0X116F: // HANGUL JUNGSEONG WEO 
104:                case 0X1170: // HANGUL JUNGSEONG WE 
105:                case 0X1171: // HANGUL JUNGSEONG WI 
106:                case 0X1172: // HANGUL JUNGSEONG YU 
107:                case 0X1173: // HANGUL JUNGSEONG EU 
108:                case 0X1174: // HANGUL JUNGSEONG YI 
109:                case 0X1175: // HANGUL JUNGSEONG I 
110:                // Hangul trailing consonants 
111:                case 0X11A8: // HANGUL JONGSEONG KIYEOK 
112:                case 0X11A9: // HANGUL JONGSEONG SSANGKIYEOK 
113:                case 0X11AA: // HANGUL JONGSEONG KIYEOK-SIOS 
114:                case 0X11AB: // HANGUL JONGSEONG NIEUN 
115:                case 0X11AC: // HANGUL JONGSEONG NIEUN-CIEUC 
116:                case 0X11AD: // HANGUL JONGSEONG NIEUN-HIEUH 
117:                case 0X11AE: // HANGUL JONGSEONG TIKEUT 
118:                case 0X11AF: // HANGUL JONGSEONG RIEUL 
119:                case 0X11B0: // HANGUL JONGSEONG RIEUL-KIYEOK 
120:                case 0X11B1: // HANGUL JONGSEONG RIEUL-MIEUM 
121:                case 0X11B2: // HANGUL JONGSEONG RIEUL-PIEUP 
122:                case 0X11B3: // HANGUL JONGSEONG RIEUL-SIOS 
123:                case 0X11B4: // HANGUL JONGSEONG RIEUL-THIEUTH 
124:                case 0X11B5: // HANGUL JONGSEONG RIEUL-PHIEUPH 
125:                case 0X11B6: // HANGUL JONGSEONG RIEUL-HIEUH 
126:                case 0X11B7: // HANGUL JONGSEONG MIEUM 
127:                case 0X11B8: // HANGUL JONGSEONG PIEUP 
128:                case 0X11B9: // HANGUL JONGSEONG PIEUP-SIOS 
129:                case 0X11BA: // HANGUL JONGSEONG SIOS 
130:                case 0X11BB: // HANGUL JONGSEONG SSANGSIOS 
131:                case 0X11BC: // HANGUL JONGSEONG IEUNG 
132:                case 0X11BD: // HANGUL JONGSEONG CIEUC 
133:                case 0X11BE: // HANGUL JONGSEONG CHIEUCH 
134:                case 0X11BF: // HANGUL JONGSEONG KHIEUKH 
135:                case 0X11C0: // HANGUL JONGSEONG THIEUTH 
136:                case 0X11C1: // HANGUL JONGSEONG PHIEUPH 
137:                case 0X11C2: // HANGUL JONGSEONG HIEUH 
138:                    return true;
139:                default:
140:                    return UCharacter.getCombiningClass(x) != 0;
141:                }
142:            }
143:            /*   
144:             static public void main(String args[]) {
145:             int ch = Integer.parseInt(args[0],16);
146:             System.out.println(UCharacter.getCombiningClass(ch));
147:             }
148:             */
149:        }
150:
151:        /*
152:         *  (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
153:         *  All rights reserved.
154:         *
155:         * Redistribution and use in source and binary forms, with or without
156:         * modification, are permitted provided that the following conditions
157:         * are met:
158:         * 1. Redistributions of source code must retain the above copyright
159:         *    notice, this list of conditions and the following disclaimer.
160:         * 2. Redistributions in binary form must reproduce the above copyright
161:         *    notice, this list of conditions and the following disclaimer in the
162:         *    documentation and/or other materials provided with the distribution.
163:         * 3. The name of the author may not be used to endorse or promote products
164:         *    derived from this software without specific prior written permission.
165:
166:         * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
167:         * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
168:         * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
169:         * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
170:         * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
171:         * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
172:         * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
173:         * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
174:         * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
175:         * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
176:         */
w_w___w_.j__a__v__a__2__s___._c__o__m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.