Java Doc for ToDo.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 Reference  Class Diagram Java Document (Java Doc) 


com.sun.kvem.midp.pim.ToDo

All known Subclasses:   com.sun.kvem.midp.pim.ToDoImpl,
ToDo
public interface ToDo extends PIMItem(Code)
Represents a single To Do item in a PIM To Do database. The fields are a subset of the fields in VTODO defined by the vCalendar specification from the Internet Mail Consortium (http://www.imc.org). The subset represents those fields necessary to provide enough information about a ToDo item without compromising platform portability.

The ToDo class has many different field IDs that it can support. However, each individual ToDo object supports only fields valid for its associated list. Its ToDoList restricts what fields in a ToDo are retained. This reflects that some native ToDo databases do not support all of the fields available in a ToDo item. The methods AbstractPIMList.isSupportedField and AbstractPIMList.getSupportedFields can be used to determine if a particular ToDo field is supported by a ToDoList and therefore persisted when the ToDo is committed to its list. Attempts to set or get data based on field IDs not supported in the ToDo's ToDoList result in a javax.microedition.pim.UnsupportedFieldException .

Data

Table: Standard Fields

Fields Type of Data Associated with Field
NOTE, SUMMARY, UID PIMItem.STRING
CLASS, PRIORITY PIMItem.INT
COMPLETION_DATE, DUE, REVISION PIMItem.DATE
COMPLETED PIMItem.BOOLEAN

Required Field Support

All ToDo fields may or may not be supported by a particular list. This is due to the fact that underlying native databases may not support all of the fields defined in this API. Support for any of the fields can be determined by the method AbstractPIMList.isSupportedField .

Native ToDo databases may require some of the fields to have values assigned to them in order to be persisted. If an application does not provide values for these fields, default values are provided for the ToDo by the VM when the ToDo is persisted.

Examples

Explicit Field Use with Field Checking

This first example shows explicit field access in which each field and type ID is properly checked for support prior to use. This results in code that is more portable across PIM implementations regardless of which specific fields are supported on particular PIM list implementations. If one of the fields is not supported by the list, the field is not set in the ToDo.
 ToDoList todos = null;
 try {
 todos = (ToDoList) PIM.getInstance().openPIMList(PIM.TODO_LIST,
 PIM.READ_WRITE);
 } catch (PIMException e) {
 // An error occurred
 return;
 }
 ToDo todo = todos.createToDo();
 if (todos.isSupportedField(Event.SUMMARY))
 todo.addString(ToDo.SUMMARY, PIMItem.ATTR_NONE,
 "Buy going away present for Judy");
 if (todos.isSupportedField(Event.DUE))
 todo.addDate(ToDo.DUE, PIMItem.ATTR_NONE, new Date().getTime());
 if (todos.isSupportedField(Event.NOTE))
 todo.addString(ToDo.NOTE, PIMItem.ATTR_NONE,
 "Judy really likes stained glass and expensive pens");
 if (todos.isSupportedField(Event.PRIORITY))
 todo.addInt(ToDo.PRIORITY, PIMItem.ATTR_NONE, 2);
 if (todos.maxCategories() != 0 && todos.isCategory("Work"))
 todo.addToCategory("Work");
 }
 try {
 todo.commit();
 } catch (PIMException e) {
 // An error occured
 }
 try {
 todos.close();
 } catch (PIMException e) {
 }
 

Explicit Field Use with Exception Handling

This second example also shows explicit field access that properly handles optionally supported fields by use of a try catch block with UnsupportedFieldException. In this case, the setting of the whole ToDo is rejected if any of the fields are not supported in the particular list implementation.
 ToDoList todos = null;
 try {
 todos = (ToDoList) PIM.getInstance().openPIMList(PIM.TODO_LIST,
 PIM.READ_WRITE);
 } catch (PIMException e) {
 // An error occurred
 return;
 }
 ToDo todo = todos.createToDo();
 try {
 todo.addString(ToDo.SUMMARY, PIMItem.ATTR_NONE,
 "Buy going away present for Judy");
 todo.addDate(ToDo.DUE, PIMItem.ATTR_NONE, new Date().getTime());
 todo.addString(ToDo.NOTE, PIMItem.ATTR_NONE,
 "Judy really likes stained glass and expensive pens");
 todo.addInt(ToDo.PRIORITY, PIMItem.ATTR_NONE, 2);
 todo.addToCategory("Work");
 } catch (UnsupportedFieldException e) {
 // In this case, we choose not to save the ToDo at all if any of the
 // fields are not supported on this platform.
 System.out.println("Todo not saved");
 return;
 }
 try {
 todo.commit();
 } catch (PIMException e) {
 // An error occured
 }
 try {
 todos.close();
 } catch (PIMException e) {
 }
 

See Also:   
See Also:   Internet Mail Consortium PDI

See Also:   ToDoListImpl
since:
   PIM 1.0


Field Summary
final public static  intCLASS
     Field specifying the desired access class for this contact.
final public static  intCLASS_CONFIDENTIAL
     Constant indicating this todo's class of access is confidential.
final public static  intCLASS_PRIVATE
     Constant indicating this todo's class of access is private.
final public static  intCLASS_PUBLIC
     Constant indicating this todo's class of access is public.
final public static  intCOMPLETED
     Field ID indicating a ToDo has been completed.
final public static  intCOMPLETION_DATE
     Field ID indicating a ToDo has been completed on the date indicated by this field.
final public static  intDUE
     The date a ToDo is due.The data for this field is expressed in the same long value format as java.util.Date, which is milliseconds since the epoch (00:00:00 GMT, January 1, 1970).

Note that the value provided may be rounded-down by an implementation due to platform restrictions.

final public static  intNOTE
     Field specifying a more complete description than the SUMMARY for this ToDo.
final public static  intPRIORITY
     Field specifying the priority of this ToDo.
final public static  intREVISION
     Field specifying the last modification date and time of a ToDo item.
final public static  intSUMMARY
     Field specifying the summary or subject for this ToDo. Data for this field is of string type.
final public static  intUID
     Field specifying a unique ID for a ToDo.



Field Detail
CLASS
final public static int CLASS(Code)
Field specifying the desired access class for this contact. Data associated with this field is of int type, and can be one of the values ToDo.CLASS_PRIVATE , ToDo.CLASS_PUBLIC , or ToDo.CLASS_CONFIDENTIAL .



CLASS_CONFIDENTIAL
final public static int CLASS_CONFIDENTIAL(Code)
Constant indicating this todo's class of access is confidential.



CLASS_PRIVATE
final public static int CLASS_PRIVATE(Code)
Constant indicating this todo's class of access is private.



CLASS_PUBLIC
final public static int CLASS_PUBLIC(Code)
Constant indicating this todo's class of access is public.



COMPLETED
final public static int COMPLETED(Code)
Field ID indicating a ToDo has been completed. Data for this field is of boolean type.



COMPLETION_DATE
final public static int COMPLETION_DATE(Code)
Field ID indicating a ToDo has been completed on the date indicated by this field. The data for this field is expressed in the same long value format as java.util.Date, which is milliseconds since the epoch (00:00:00 GMT, January 1, 1970).

Note that the value provided may be rounded-down by an implementation due to platform restrictions. For example, should a native ToDo database only support todo date values with granularity in terms of seconds, then the provided date value is rounded down to a date time with a full second.




DUE
final public static int DUE(Code)
The date a ToDo is due.The data for this field is expressed in the same long value format as java.util.Date, which is milliseconds since the epoch (00:00:00 GMT, January 1, 1970).

Note that the value provided may be rounded-down by an implementation due to platform restrictions. For example, should a native ToDo database only support todo date values with granularity in terms of seconds, then the provided date value is rounded down to a date time with a full second.




NOTE
final public static int NOTE(Code)
Field specifying a more complete description than the SUMMARY for this ToDo. Data for this field is of string type. For example:
"Judy really likes stained glass and expensive pens"



PRIORITY
final public static int PRIORITY(Code)
Field specifying the priority of this ToDo. The priority is a value from zero to nine. Zero specifies an undefined priority, one specifies the highest priority and nine the lowest priority. It is not guaranteed that this value remains unchanged after setting the value and/or persistence of the ToDo item due to underlying native database priority support and mappings to the native priority values. Data for this field is of int type.



REVISION
final public static int REVISION(Code)
Field specifying the last modification date and time of a ToDo item. If the ToDo has ever been committed to a ToDoList, then this attribute becomes read only. This field is set automatically on imports and commits of a ToDo. Data for this field is expressed in the same long value format as java.util.Date, which is milliseconds since the epoch (00:00:00 GMT, January 1, 1970).

Note that the value provided may be rounded-down by an implementation due to platform restrictions. For example, should a native ToDo database only support todo date values with granularity in terms of seconds, then the provided date value is rounded down to a date time with a full second.




SUMMARY
final public static int SUMMARY(Code)
Field specifying the summary or subject for this ToDo. Data for this field is of string type. For example:
"Buy going away present for Judy"



UID
final public static int UID(Code)
Field specifying a unique ID for a ToDo. This field can be used to check for identity using String.equals. UID is read only if the ToDo has been committed to a ToDoList at least once in its lifetime. The UID is not set if the ToDo has never been committed to a ToDoList; countValues(UID) returns 0 before a newly created ToDo object is committed to its list. The attribute is valid for the persistent life of the ToDo and may be reused by the platform once this particular ToDo is deleted. Data for this field is of string type.





www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.