Source Code Cross Referenced for TimeZoneAdapter.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) 2003-2006, International Business Machines
004:         * Corporation and others.  All Rights Reserved.
005:         **********************************************************************
006:         * Author: Alan Liu
007:         * Created: October 2 2003
008:         * Since: ICU 2.8
009:         **********************************************************************
010:         */
011:        package com.ibm.icu.impl;
012:
013:        import com.ibm.icu.util.TimeZone;
014:        import java.util.Date;
015:
016:        /**
017:         * <code>TimeZoneAdapter</code> wraps a com.ibm.icu.util.TimeZone
018:         * subclass that is NOT a JDKTimeZone, that is, that does not itself
019:         * wrap a java.util.TimeZone.  It inherits from java.util.TimeZone.
020:         * Without this class, we would need to 'port' java.util.Date to
021:         * com.ibm.icu.util as well, so that Date could interoperate properly
022:         * with the com.ibm.icu.util TimeZone and Calendar classes.  With this
023:         * class, we can use java.util.Date together with com.ibm.icu.util
024:         * classes.
025:         *
026:         * The complement of this is JDKTimeZone, which makes a
027:         * java.util.TimeZone look like a com.ibm.icu.util.TimeZone.
028:         *
029:         * @see com.ibm.icu.impl.JDKTimeZone
030:         * @see com.ibm.icu.util.TimeZone#setDefault
031:         * @author Alan Liu
032:         * @since ICU 2.8
033:         */
034:        public class TimeZoneAdapter extends java.util.TimeZone {
035:
036:            // Generated by serialver from JDK 1.4.1_01
037:            static final long serialVersionUID = -2040072218820018557L;
038:
039:            /**
040:             * The contained com.ibm.icu.util.TimeZone object.  Must not be null.
041:             * We delegate all methods to this object.
042:             */
043:            private TimeZone zone;
044:
045:            /**
046:             * Given a java.util.TimeZone, wrap it in the appropriate adapter
047:             * subclass of com.ibm.icu.util.TimeZone and return the adapter.
048:             */
049:            public static java.util.TimeZone wrap(com.ibm.icu.util.TimeZone tz) {
050:                return new TimeZoneAdapter(tz);
051:            }
052:
053:            /**
054:             * Return the java.util.TimeZone wrapped by this object.
055:             */
056:            public com.ibm.icu.util.TimeZone unwrap() {
057:                return zone;
058:            }
059:
060:            /**
061:             * Constructs an adapter for a com.ibm.icu.util.TimeZone object.
062:             * 
063:             * @internal
064:             * @deprecated This API is ICU internal only.
065:             */
066:            public TimeZoneAdapter(TimeZone zone) {
067:                this .zone = zone;
068:                super .setID(zone.getID());
069:            }
070:
071:            /**
072:             * TimeZone API; calls through to wrapped time zone.
073:             */
074:            public void setID(String ID) {
075:                super .setID(ID);
076:                zone.setID(ID);
077:            }
078:
079:            /**
080:             * TimeZone API; calls through to wrapped time zone.
081:             */
082:            public boolean hasSameRules(java.util.TimeZone other) {
083:                return other instanceof  TimeZoneAdapter
084:                        && zone.hasSameRules(((TimeZoneAdapter) other).zone);
085:            }
086:
087:            /**
088:             * TimeZone API; calls through to wrapped time zone.
089:             */
090:            public int getOffset(int era, int year, int month, int day,
091:                    int dayOfWeek, int millis) {
092:                return zone.getOffset(era, year, month, day, dayOfWeek, millis);
093:            }
094:
095:            /**
096:             * TimeZone API; calls through to wrapped time zone.
097:             */
098:            public int getRawOffset() {
099:                return zone.getRawOffset();
100:            }
101:
102:            /**
103:             * TimeZone API; calls through to wrapped time zone.
104:             */
105:            public void setRawOffset(int offsetMillis) {
106:                zone.setRawOffset(offsetMillis);
107:            }
108:
109:            /**
110:             * TimeZone API; calls through to wrapped time zone.
111:             */
112:            public boolean useDaylightTime() {
113:                return zone.useDaylightTime();
114:            }
115:
116:            /**
117:             * TimeZone API; calls through to wrapped time zone.
118:             */
119:            public boolean inDaylightTime(Date date) {
120:                return zone.inDaylightTime(date);
121:            }
122:
123:            /**
124:             * Boilerplate API; calls through to wrapped object.
125:             */
126:            public Object clone() {
127:                return new TimeZoneAdapter((TimeZone) zone.clone());
128:            }
129:
130:            /**
131:             * Boilerplate API; calls through to wrapped object.
132:             */
133:            public synchronized int hashCode() {
134:                return zone.hashCode();
135:            }
136:
137:            /**
138:             * Boilerplate API; calls through to wrapped object.
139:             */
140:            public boolean equals(Object obj) {
141:                if (obj instanceof  TimeZoneAdapter) {
142:                    obj = ((TimeZoneAdapter) obj).zone;
143:                }
144:                return zone.equals(obj);
145:            }
146:
147:            /**
148:             * Returns a string representation of this object.
149:             * @return  a string representation of this object.
150:             */
151:            public String toString() {
152:                return "TimeZoneAdapter: " + zone.toString();
153:            }
154:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.