Source Code Cross Referenced for PIMFieldDescriptor.java in  » 6.0-JDK-Modules » j2me » com » sun » kvem » midp » pim » 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 » com.sun.kvem.midp.pim 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *   
003:         *
004:         * Copyright  1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006:         * 
007:         * This program is free software; you can redistribute it and/or
008:         * modify it under the terms of the GNU General Public License version
009:         * 2 only, as published by the Free Software Foundation.
010:         * 
011:         * This program is distributed in the hope that it will be useful, but
012:         * WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014:         * General Public License version 2 for more details (a copy is
015:         * included at /legal/license.txt).
016:         * 
017:         * You should have received a copy of the GNU General Public License
018:         * version 2 along with this work; if not, write to the Free Software
019:         * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020:         * 02110-1301 USA
021:         * 
022:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023:         * Clara, CA 95054 or visit www.sun.com if you need additional
024:         * information or have any questions.
025:         */
026:
027:        package com.sun.kvem.midp.pim;
028:
029:        import com.sun.midp.main.Configuration;
030:
031:        /**
032:         * Specification of a PIM field.
033:         *
034:         */
035:        public class PIMFieldDescriptor {
036:
037:            /** PIM: field. */
038:            private int field;
039:            /** PIM: type. */
040:            private int dataType;
041:            /** PIM: is the default value present? */
042:            private boolean hasDefaultValue;
043:            /** PIM: default value. */
044:            private Object defaultValue;
045:            /** PIM: label. */
046:            private String label;
047:            /** PIM: label resources. */
048:            String[] labelResources;
049:            /** PIM: attributes. */
050:            private long attributes;
051:            /** PIM: maximum number of values or -1 for unlimited data. */
052:            private int maxValues;
053:
054:            /**
055:             * Constructor: field initialization.
056:             *
057:             * @param field           ID
058:             * @param dataType        type
059:             * @param hasDefaultValue is the default value present?
060:             * @param defaultValue    default value of the field
061:             * @param labelResource   label
062:             * @param labelResources  array of label resources
063:             * @param attributes      field attributes
064:             * @param maxValues       maximum number of values or -1
065:             */
066:            public PIMFieldDescriptor(int field, int dataType,
067:                    boolean hasDefaultValue, Object defaultValue,
068:                    String labelResource, String[] labelResources,
069:                    long attributes, int maxValues) {
070:
071:                this .field = field;
072:                this .dataType = dataType;
073:                this .hasDefaultValue = hasDefaultValue;
074:                this .defaultValue = defaultValue;
075:                this .label = Configuration.getPropertyDefault(labelResource,
076:                        "Label_" + labelResource);
077:                this .labelResources = labelResources;
078:                this .attributes = attributes;
079:                this .maxValues = maxValues;
080:            }
081:
082:            /**
083:             * Constructor: field initialization.
084:             *
085:             * @param field           ID
086:             * @param dataType        type
087:             * @param hasDefaultValue is the default value present?
088:             * @param defaultValue    default value of the field
089:             * @param labelResource   label (labelResources = null)
090:             * @param attributes      field attributes
091:             * @param maxValues       maximum number of values or -1
092:             */
093:            public PIMFieldDescriptor(int field, int dataType,
094:                    boolean hasDefaultValue, Object defaultValue,
095:                    String labelResource, long attributes, int maxValues) {
096:
097:                this (field, dataType, hasDefaultValue, defaultValue,
098:                        labelResource, null, attributes, maxValues);
099:            }
100:
101:            /**
102:             * Gets field ID.
103:             *
104:             * @return the field ID
105:             */
106:            public int getField() {
107:                return field;
108:            }
109:
110:            /**
111:             * Gets field type.
112:             *
113:             * @return the field type
114:             */
115:            public int getDataType() {
116:                return dataType;
117:            }
118:
119:            /**
120:             * Gets field label.
121:             *
122:             * @return the field label
123:             */
124:            public String getLabel() {
125:                return label;
126:            }
127:
128:            /**
129:             * Checks if the field has a default value?
130:             *
131:             * @return true if the field has a default value?
132:             */
133:            public boolean hasDefaultValue() {
134:                return hasDefaultValue;
135:            }
136:
137:            /**
138:             * Gets the default value.
139:             *
140:             * @return the default value
141:             */
142:            public Object getDefaultValue() {
143:                return defaultValue;
144:            }
145:
146:            /**
147:             * Gets the length of array (type STRING_ARRAY).
148:             *
149:             * @return the length of array
150:             */
151:            public int getStringArraySize() {
152:                return labelResources.length;
153:            }
154:
155:            /**
156:             * Gets the label.
157:             *
158:             * @param arrayElement   index of label in labelResources array
159:             * @return the label
160:             */
161:            public String getElementlabel(int arrayElement) {
162:                return Configuration.getPropertyDefault(
163:                        labelResources[arrayElement], "Label_"
164:                                + labelResources[arrayElement]);
165:            }
166:
167:            /**
168:             * Gets the supported attributes.
169:             *
170:             * @return the set of supported attributes
171:             */
172:            public long getSupportedAttributes() {
173:                return attributes;
174:            }
175:
176:            /**
177:             * Gets the maximum values.
178:             *
179:             * @return the maximum values
180:             */
181:            public int getMaximumValues() {
182:                return maxValues;
183:            }
184:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.