Source Code Cross Referenced for CalendarData.java in  » Internationalization-Localization » icu4j » com » ibm » icu » 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 » Internationalization Localization » icu4j » com.ibm.icu.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *******************************************************************************
003:         * Copyright (C) 2004-2005, International Business Machines Corporation and         *
004:         * others. All Rights Reserved.                                                *
005:         *******************************************************************************
006:         */
007:
008:        package com.ibm.icu.impl;
009:
010:        import java.util.MissingResourceException;
011:
012:        import com.ibm.icu.util.ULocale;
013:        import com.ibm.icu.util.UResourceBundle;
014:
015:        /**
016:         * This class abstracts access to calendar (Calendar and DateFormat) data.
017:         * @internal ICU 3.0
018:         */
019:        public class CalendarData {
020:            /**
021:             * Construct a CalendarData from the given locale.
022:             * @param loc locale to use. The 'calendar' keyword will be ignored.
023:             * @param type calendar type. NULL indicates the gregorian calendar. 
024:             * No default lookup is done.
025:             */
026:            public CalendarData(ULocale loc, String type) {
027:                this ((ICUResourceBundle) UResourceBundle.getBundleInstance(
028:                        ICUResourceBundle.ICU_BASE_NAME, loc), type);
029:            }
030:
031:            public CalendarData(ICUResourceBundle b, String type) {
032:                fBundle = b;
033:                if ((type == null) || (type.equals(""))
034:                        || (type.equals("gregorian"))) {
035:                    fMainType = "gregorian";
036:                    fFallbackType = null;
037:                } else {
038:                    fMainType = type;
039:                    fFallbackType = "gregorian";
040:                }
041:            }
042:
043:            /**
044:             * Load data for calendar. Note, this object owns the resources, do NOT call ures_close()!
045:             *
046:             * @param key Resource key to data
047:             * @internal
048:             */
049:            public ICUResourceBundle get(String key) {
050:                try {
051:                    return fBundle.getWithFallback("calendar/" + fMainType
052:                            + "/" + key);
053:                } catch (MissingResourceException m) {
054:                    if (fFallbackType != null) {
055:                        return fBundle.getWithFallback("calendar/"
056:                                + fFallbackType + "/" + key);
057:                    }
058:                    throw m;
059:
060:                }
061:            }
062:
063:            /**
064:             * Load data for calendar. Note, this object owns the resources, do NOT call ures_close()!
065:             * There is an implicit key of 'format'
066:             * data is located in:   "calendar/key/format/subKey"
067:             * for example,  calendar/dayNames/format/abbreviated
068:             *
069:             * @param key Resource key to data
070:             * @param subKey Resource key to data
071:             * @internal
072:             */
073:            public ICUResourceBundle get(String key, String subKey) {
074:                try {
075:                    return fBundle.getWithFallback("calendar/" + fMainType
076:                            + "/" + key + "/format/" + subKey);
077:                } catch (MissingResourceException m) {
078:                    if (fFallbackType != null) {
079:                        return fBundle.getWithFallback("calendar/"
080:                                + fFallbackType + "/" + key + "/format/"
081:                                + subKey);
082:                    }
083:                    throw m;
084:
085:                }
086:            }
087:
088:            /**
089:             * Load data for calendar. Note, this object owns the resources, do NOT call ures_close()!
090:             * data is located in:   "calendar/key/contextKey/subKey"
091:             * for example,  calendar/dayNames/stand-alone/narrow
092:             *
093:             * @param key Resource key to data
094:             * @param contextKey Resource key to data
095:             * @param subKey Resource key to data
096:             * @internal
097:             */
098:            public ICUResourceBundle get(String key, String contextKey,
099:                    String subKey) {
100:                try {
101:                    return fBundle.getWithFallback("calendar/" + fMainType
102:                            + "/" + key + "/" + contextKey + "/" + subKey);
103:                } catch (MissingResourceException m) {
104:                    if (fFallbackType != null) {
105:                        return fBundle.getWithFallback("calendar/"
106:                                + fFallbackType + "/" + key + "/" + contextKey
107:                                + "/" + subKey);
108:                    }
109:                    throw m;
110:
111:                }
112:            }
113:
114:            public String[] getStringArray(String key) {
115:                return get(key).getStringArray();
116:            }
117:
118:            public String[] getStringArray(String key, String subKey) {
119:                return get(key, subKey).getStringArray();
120:            }
121:
122:            public String[] getStringArray(String key, String contextKey,
123:                    String subKey) {
124:                return get(key, contextKey, subKey).getStringArray();
125:            }
126:
127:            public String[] getEras(String subkey) {
128:                ICUResourceBundle bundle = get("eras/" + subkey);
129:                return bundle.getStringArray();
130:            }
131:
132:            public ULocale getULocale() {
133:                return fBundle.getULocale();
134:            }
135:
136:            private ICUResourceBundle fBundle;
137:            private String fMainType;
138:            private String fFallbackType;
139:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.