Source Code Cross Referenced for TelephoneNumber.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 gov.nist.core.*;
028:        import gov.nist.siplite.SIPConstants;
029:
030:        /**
031:         * Telephone number class.
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 TelephoneNumber extends GenericObject {
039:            /** Post dial method string. */
040:            public static final String POSTDIAL = SIPConstants.GENERAL_POSTDIAL;
041:            /** Phone context tag string. */
042:            public static final String PHONE_CONTEXT_TAG = SIPConstants.GENERAL_PHONE_CONTEXT_TAG;
043:            /** ISDN subaddress parameter label. */
044:            public static final String ISUB = SIPConstants.GENERAL_ISUB;
045:            /** Provider tag label. */
046:            public static final String PROVIDER_TAG = SIPConstants.GENERAL_PROVIDER_TAG;
047:
048:            /**
049:             * Flag indicating international phone number.
050:             */
051:            protected boolean isglobal;
052:
053:            /**
054:             * Phone number field.
055:             */
056:            protected String phoneNumber;
057:
058:            /**
059:             * Parmeters list.
060:             */
061:            protected NameValueList parms;
062:
063:            /**
064:             * Creates new TelephoneNumber.
065:             */
066:            public TelephoneNumber() {
067:                parms = new NameValueList("telparms");
068:            }
069:
070:            /**
071:             * Deletes the specified parameter.
072:             * @param name String to set
073:             */
074:            public void deleteParm(String name) {
075:                parms.delete(name);
076:            }
077:
078:            /**
079:             * Gets the PhoneNumber field.
080:             * @return the phone number
081:             */
082:            public String getPhoneNumber() {
083:                return phoneNumber;
084:            }
085:
086:            /**
087:             * Gets the PostDial field.
088:             * @return String
089:             */
090:            public String getPostDial() {
091:                return (String) parms.getValue(POSTDIAL);
092:            }
093:
094:            /**
095:             * Get the isdn subaddress for this number.
096:             * @return String
097:             */
098:            public String getIsdnSubaddress() {
099:                return (String) parms.getValue(ISUB);
100:            }
101:
102:            /**
103:             * Returns true if the PostDial field exists.
104:             * @return true if post dial field is included
105:             */
106:            public boolean hasPostDial() {
107:                return parms.getValue(POSTDIAL) != null;
108:            }
109:
110:            /**
111:             * Returns true if this header has parameters.
112:             * @param pname String to set
113:             * @return true if parameter is present
114:             */
115:            public boolean hasParm(String pname) {
116:                return parms.hasNameValue(pname);
117:            }
118:
119:            /**
120:             * Returns true if the isdn subaddress exists.
121:             * @return True if isdn sub address exists.
122:             */
123:            public boolean hasIsdnSubaddress() {
124:                return hasParm(ISUB);
125:            }
126:
127:            /**
128:             * Returns tru if telephone number is a global telephone number.
129:             * @return true if global phone number
130:             */
131:            public boolean isGlobal() {
132:                return isglobal;
133:            }
134:
135:            /**
136:             * Removes the PostDial field.
137:             */
138:            public void removePostDial() {
139:                parms.delete(POSTDIAL);
140:            }
141:
142:            /**
143:             * Removes the isdn subaddress (if it exists).
144:             */
145:            public void removeIsdnSubaddress() {
146:                deleteParm(ISUB);
147:            }
148:
149:            /**
150:             * Sets the list of parameters.
151:             * @param p NameValueList to set
152:             */
153:            public void setParameters(NameValueList p) {
154:                parms = p;
155:            }
156:
157:            /**
158:             * Sets the Global field.
159:             * @param g boolean to set
160:             */
161:            public void setGlobal(boolean g) {
162:                isglobal = g;
163:            }
164:
165:            /**
166:             * Sets the PostDial field.
167:             * @param p String to set
168:             */
169:            public void setPostDial(String p) {
170:                NameValue nv = new NameValue(POSTDIAL, p);
171:                parms.add(nv);
172:            }
173:
174:            /**
175:             * Sets the specified parameter.
176:             * @param name String to set
177:             * @param value Object to set
178:             */
179:            public void setParm(String name, Object value) {
180:                NameValue nv = new NameValue(name, value);
181:                parms.add(nv);
182:            }
183:
184:            /**
185:             * Sets the isdn subaddress for this structure.
186:             * @param isub String to set
187:             */
188:            public void setIsdnSubaddress(String isub) {
189:                setParm(ISUB, isub);
190:            }
191:
192:            /**
193:             * Sets the PhoneNumber field
194:             * @param num String to set
195:             */
196:            public void setPhoneNumber(String num) {
197:                phoneNumber = num;
198:            }
199:
200:            /**
201:             *( Encodes instance contents as a string.
202:             * @return encoded string of object contents
203:             */
204:            public String encode() {
205:                String retval = "";
206:                if (isglobal)
207:                    retval += "+";
208:                retval += phoneNumber;
209:                if (!parms.isEmpty()) {
210:                    retval += Separators.SEMICOLON;
211:                    retval += parms.encode();
212:                }
213:                return retval;
214:            }
215:
216:            /**
217:             * Copies the current object.
218:             * @return copy of current instance
219:             */
220:            public Object clone() {
221:                TelephoneNumber retval = new TelephoneNumber();
222:                retval.isglobal = this .isglobal;
223:                retval.phoneNumber = new String(this .phoneNumber);
224:                retval.parms = (NameValueList) this.parms.clone();
225:                return retval;
226:            }
227:
228:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.