Source Code Cross Referenced for Element.java in  » Portal » Open-Portal » com » sun » addressbook » 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 » Portal » Open Portal » com.sun.addressbook 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * %W% %G%
003:         * Copyright 2002 Sun Microsystems, Inc. All
004:         * rights reserved. Use of this product is subject
005:         * to license terms. Federal Acquisitions:
006:         * Commercial Software -- Government Users
007:         * Subject to Standard License Terms and
008:         * Conditions.
009:         *
010:         * Sun, Sun Microsystems, the Sun logo, and iPlanet
011:         * are trademarks or registered trademarks of Sun Microsystems,
012:         * Inc. in the United States and other countries.
013:         */package com.sun.addressbook;
014:
015:        import java.util.Map;
016:        import java.util.HashMap;
017:
018:        /**
019:         * Element - Element is a base class for the Entry, Group and the AddressBook 
020:         * beans.
021:         * 
022:         * 
023:         */
024:
025:        public class Element {
026:
027:            /* 
028:             * The fields of the Element
029:             *
030:             */
031:
032:            /**
033:             * Unique name.
034:             */
035:            protected String un = null;
036:
037:            /**
038:             * Common name.
039:             */
040:            protected String cn = null;
041:
042:            /**
043:             * Note for the address book entry.
044:             */
045:            protected String description = null;
046:
047:            /**
048:             * ElementType - either Entry, Group, or Address Book
049:             */
050:            protected int elementType = -1;
051:
052:            /**
053:             * Index of the element
054:             */
055:            protected String entryid = null;
056:
057:            /**
058:             * Additional properties to be stored in the Element. These are specific
059:             * to the adapters. Check the docs for the adapters to see the exact 
060:             * additional properties supported.
061:             */
062:            protected Map properties = null;
063:
064:            /** 
065:             * Type elements  constants
066:             */
067:            public static final int ENTRY = 1;
068:            public static final int GROUP = 2;
069:            public static final int ALL = 3;
070:            public static final int ADDRESSBOOK = 4;
071:            public static final int UNSPECIFIED = -1;
072:
073:            /**
074:             * Get  Common name.
075:             * 
076:             * @return cn  String 
077:             */
078:            public String getCn() {
079:                return cn;
080:            }
081:
082:            /**
083:             * Get  description. 
084:             * 
085:             * @return description  String 
086:             */
087:            public String getDescription() {
088:                return description;
089:            }
090:
091:            /**
092:             * Get unique name.
093:             * 
094:             * @return un  String 
095:             */
096:            public String getUn() {
097:                return un;
098:            }
099:
100:            /**
101:             * Get entryid.
102:             * 
103:             * @return entryid  String 
104:             */
105:            public String getEntryid() {
106:                return entryid;
107:            }
108:
109:            /**
110:             * Set common name.
111:             * 
112:             * @param value   the cn String
113:             */
114:            public void setCn(String value) {
115:                cn = value;
116:            }
117:
118:            /**
119:             * Set description. 
120:             * 
121:             * @param value   the description String
122:             */
123:            public void setDescription(String value) {
124:                description = value;
125:            }
126:
127:            /**
128:             * Set unique name.
129:             * 
130:             * @param value   the un String
131:             */
132:            public void setUn(String value) {
133:                un = value;
134:            }
135:
136:            /**
137:             * Set entryid.
138:             * 
139:             * @param value   the entryid String
140:             */
141:            public void setEntryid(String value) {
142:                entryid = value;
143:            }
144:
145:            /**
146:             * Method to retreive a particular entry property.
147:             *
148:             * @return value of property
149:             */
150:            public Object getProperty(String property) {
151:                if (properties != null) {
152:                    return properties.get(property);
153:                }
154:                return null;
155:            }
156:
157:            /**
158:             * Method to check if a particular property exists.
159:             *
160:             * @return true if property exists, false otherwise
161:             */
162:            public boolean hasProperty(String property) {
163:                if (properties != null) {
164:                    return properties.containsKey(property);
165:                }
166:                return false;
167:            }
168:
169:            /**
170:             * Set additional properties that maybe associated with this entry bean. These 
171:             * are specific to the adapter.
172:             *
173:             * @param property		property keyword
174:             * @param value		value of property
175:             */
176:            public void setProperty(String property, Object value) {
177:                if (properties == null) {
178:                    properties = new HashMap();
179:                }
180:                properties.put(property, value);
181:            }
182:
183:            /**
184:             * Get ElementType
185:             * 
186:             * @return int indicating an element type
187:             */
188:            public int getElementType() {
189:                return elementType;
190:            }
191:
192:            /**
193:             * Set ElementType
194:             * 
195:             * @param int indicating an element type
196:             */
197:            public void setElementType(int elementType) {
198:                this .elementType = elementType;
199:            }
200:
201:            /**
202:             * Convenience method to check if element is of type Entry
203:             *
204:             * @return boolean indicating whether elementType is Entry
205:             */
206:            public boolean isEntry() {
207:                if (this .elementType == ENTRY) {
208:                    return true;
209:                }
210:                return false;
211:            }
212:
213:            /**
214:             * Convenience method to check if element is of type Group
215:             *
216:             * @return boolean indicating whether elementType is Group
217:             */
218:            public boolean isGroup() {
219:                if (this .elementType == GROUP) {
220:                    return true;
221:                }
222:                return false;
223:            }
224:
225:            /**
226:             * Convenience method to check if element is of type AddressBook
227:             *
228:             * @return boolean indicating whether elementType is AddressBook
229:             */
230:            public boolean isAddressBook() {
231:                if (this .elementType == ADDRESSBOOK) {
232:                    return true;
233:                }
234:                return false;
235:            }
236:
237:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.