Source Code Cross Referenced for TelURL.java in  » 6.0-JDK-Modules » j2me » gov » nist » siplite » address » 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 » 6.0 JDK Modules » j2me » gov.nist.siplite.address 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Portions Copyright  2000-2007 Sun Microsystems, Inc. All Rights
003:         * Reserved.  Use is subject to license terms.
004:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
005:         * 
006:         * This program is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU General Public License version
008:         * 2 only, as published by the Free Software Foundation.
009:         * 
010:         * This program is distributed in the hope that it will be useful, but
011:         * WITHOUT ANY WARRANTY; without even the implied warranty of
012:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013:         * General Public License version 2 for more details (a copy is
014:         * included at /legal/license.txt).
015:         * 
016:         * You should have received a copy of the GNU General Public License
017:         * version 2 along with this work; if not, write to the Free Software
018:         * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
019:         * 02110-1301 USA
020:         * 
021:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
022:         * Clara, CA 95054 or visit www.sun.com if you need additional
023:         * information or have any questions.
024:         */
025:        package gov.nist.siplite.address;
026:
027:        import java.util.Vector;
028:
029:        /**
030:         * Implementation of the TelURL interface.
031:         *
032:         * @version JAIN-SIP-1.1
033:         *
034:         *
035:         * <a href="{@docRoot}/uncopyright.html">This code is in the public domain.</a>
036:         *
037:         */
038:        public class TelURL extends URI {
039:
040:            /** Currrent telephone portion of URI. */
041:            protected TelephoneNumber telephoneNumber;
042:
043:            /** Creates a new instance of TelURLImpl */
044:            public TelURL() {
045:                this .scheme = "tel";
046:            }
047:
048:            /**
049:             * Sets the telephone number.
050:             * @param telephoneNumber telephone number to set.
051:             */
052:
053:            public void setTelephoneNumber(TelephoneNumber telephoneNumber) {
054:                this .telephoneNumber = telephoneNumber;
055:            }
056:
057:            /**
058:             * Returns the value of the <code>isdnSubAddress</code> parameter, or null
059:             * if it is not set.
060:             *
061:             * @return the value of the <code>isdnSubAddress</code> parameter
062:             */
063:            public String getIsdnSubAddress() {
064:                return telephoneNumber.getIsdnSubaddress();
065:            }
066:
067:            /**
068:             * Returns the value of the <code>postDial</code> parameter, or null if it
069:             * is not set.
070:             *
071:             * @return the value of the <code>postDial</code> parameter
072:             */
073:            public String getPostDial() {
074:                return telephoneNumber.getPostDial();
075:            }
076:
077:            /**
078:             * Returns <code>true</code> if this TelURL is global i.e. if the TelURI
079:             * has a global phone user.
080:             *
081:             * @return <code>true</code> if this TelURL represents a global phone user,
082:             * and <code>false</code> otherwise.
083:             */
084:            public boolean isGlobal() {
085:                return telephoneNumber.isGlobal();
086:            }
087:
088:            /**
089:             * This method determines if this is a URI with a scheme of "sip"
090:             * or "sips".
091:             *
092:             * @return true if the scheme is "sip" or "sips", false otherwise.
093:             */
094:            public boolean isSipURI() {
095:                return false;
096:            }
097:
098:            /**
099:             * This method determines if this is a URI with a scheme of
100:             * "tel"
101:             *
102:             * @return true if the scheme is "tel", false otherwise.
103:             */
104:            public boolean isTelURL() {
105:                return true;
106:            }
107:
108:            /**
109:             * Sets phone user of this TelURL to be either global or local. The default
110:             * value is false, hence the TelURL is defaulted to local.
111:             *
112:             * @param global - the boolean value indicating if the TelURL has a global
113:             * phone user.
114:             */
115:            public void setGlobal(boolean global) {
116:                this .telephoneNumber.setGlobal(true);
117:            }
118:
119:            /**
120:             * Sets ISDN subaddress of this TelURL. If a subaddress is present, it is
121:             * appended to the phone number after ";isub=".
122:             *
123:             * @param isdnSubAddress - new value of the <code>isdnSubAddress</code>
124:             * parameter
125:             */
126:            public void setIsdnSubAddress(String isdnSubAddress) {
127:                this .telephoneNumber.setIsdnSubaddress(isdnSubAddress);
128:            }
129:
130:            /**
131:             * Sets post dial of this TelURL. The post-dial sequence describes what and
132:             * when the local entity should send to the phone line.
133:             *
134:             * @param postDial - new value of the <code>postDial</code> parameter
135:             */
136:            public void setPostDial(String postDial) {
137:                this .telephoneNumber.setPostDial(postDial);
138:            }
139:
140:            /**
141:             * Set the telephone number.
142:             * @param telephoneNumber -- long phone number to set.
143:             */
144:            public void setPhoneNumber(String telephoneNumber) {
145:                this .telephoneNumber.setPhoneNumber(telephoneNumber);
146:            }
147:
148:            /**
149:             * Get the telephone number.
150:             *
151:             * @return -- the telephone number.
152:             */
153:            public String getPhoneNumber() {
154:                return this .telephoneNumber.getPhoneNumber();
155:            }
156:
157:            /**
158:             * Return the string encoding.
159:             *
160:             * @return -- the string encoding.
161:             */
162:            public String toString() {
163:                return this .scheme + ":" + telephoneNumber.encode();
164:            }
165:
166:            /**
167:             * Encodes contents in a string.
168:             * @return encoded string of object contents
169:             */
170:            public String encode() {
171:                return this .scheme + ":" + telephoneNumber.encode();
172:            }
173:
174:            /**
175:             * Returns the URI part of the address (without parameters)
176:             * i.e. scheme:user@host:port.
177:             * @return URI part of the address
178:             */
179:            public String getPlainURI() {
180:                StringBuffer retval = new StringBuffer();
181:                retval.append(scheme).append(":");
182:                if (telephoneNumber.isGlobal()) {
183:                    retval.append("+");
184:                }
185:                retval.append(telephoneNumber.getPhoneNumber());
186:                return retval.toString();
187:            }
188:
189:            /**
190:             * Returns an Iterator over the names (Strings) of all parameters present
191:             * in this ParametersHeader.
192:             * @return an Iterator over all the parameter names
193:             *
194:             */
195:            public Vector getParameterNames() {
196:                if (null != telephoneNumber) {
197:                    return telephoneNumber.parms.getNames();
198:                }
199:                return null;
200:            }
201:
202:            /**
203:             * Deep copy clone operation.
204:             *
205:             * @return -- a cloned version of this telephone number.
206:             */
207:            public Object clone() {
208:                TelURL retval = new TelURL();
209:                retval.scheme = this .scheme;
210:                if (this .telephoneNumber != null) {
211:                    retval.telephoneNumber = (TelephoneNumber) this.telephoneNumber
212:                            .clone();
213:                }
214:                return retval;
215:            }
216:
217:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.