|
PDAP Public Review Draft | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 1.0 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 element.
The methods PIMList.isSupportedField(int)
and PIMList.getSupportedTypes(int)
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 PIMException
.
An event contains three types of data:
PIMElement.getString(int)
and PIMElement.setString(int, String)
are used for ToDo.NOTE
since a String value is associated with notes).
Extended fields are fields that does not have a specific field explicitly predefined
in the API, but do have field ids assigned by the ToDo list. These fields
are implementation dependent and can vary. Users can find out a field id is
is extended field through the method PIMList.isExtendedField(int)
. Users
can also find out the data type for the field (PIMElement.getFieldDataType(int)
)
and the human readable label for the field (PIMElement.getFieldLabel(int)
).
Extended fields use the same get and set methods as named fields.
Categories are string items. There is no limit to the number of categories that a ToDo can be associated with.
Field IDs | Type of Data Associated with Field |
---|---|
NOTE, SUMMARY, UID |
PIMElement.STRING |
PRIORITY |
PIMElement.INT |
COMPLETED, DUE, REVISION |
PIMElement.DATE |
SUMMARY
is the only field that is required to be supported
in a ToDo and its List. All other fields may or may not be required by the list. Support
for all fields can be determined by the method PIMList.isSupportedField(int)
.
PIMElement.fromSerialFormat(java.io.Reader)
initializes an ToDo from vCalendar 1.0 information contained
in the given Reader object. The Unicode character stream starting from the Reader's
current character position must be a complete vCalendar 1.0 entry or else a
PIMException
is thrown. This method reads one complete vCalendar
entry at a time, leaving the Reader object character position on the character
after the end of the vCalendar entry. It is the responsibility of the application
to perform any character decoding prior to providing the Reader object with
the vCalendar entry.PIMElement.toSerialFormat(java.io.Writer)
writes the data from this ToDo
to the given Writer object as Unicode characters in a vCalendar 1.0 format.
The character stream is a complete vCalendar entry and
suitable for exchange with other implementations of vCalendar. It is the
responsibility of the application to perform any necessary character encoding
needed for further transportation of the vCalendar entry. This method is
equivalent to invoking PIMElement.toSerialFormat(java.io.Writer, String)
with
a version parameter of "1.0".
PIMElement.toSerialFormat(java.io.Writer, String)
writes the data from this ToDo
to the given Writer object as Unicode characters in a vCalendar format whose
version is indicated by the String parameter. The value of the String must
be a valid vCalendar VERSION
value as defined by the appropriate
vCalendar specifications or else an IllegalArgumentException
is thrown.
The character stream is a complete vCalendar entry and suitable for exchange with
other implementations of vCalendar. It is the responsibility of the application
to perform any necessary character encoding needed for further transportation
of the vCalendar entry.
ToDoList todoList = null; try { todoList = PIM.openToDoList(PIM.READ_WRITE); } catch (PIMException e) { // An error occured return; } ToDo todo = todoList.createToDo(); todo.setString(ToDo.SUMMARY, "Buy going away present for Judy"); todo.setDate(ToDo.DUE, new Date().getTime()); todo.setString(ToDo.NOTE, "Judy really likes stained glass and expensive pens"); todo.setInt(ToDo.PRIORITY, 2); // Add a category to this todo todo.addToCategory("Work"); try { todo.commit(); } catch (PIMException e) { // An error occured } try { todoList.close(); } catch (PIMException e) { }
ToDoList
Field Summary | |
static int |
COMPLETED
Field ID indicating a ToDo has been completed. |
static int |
DUE
The Date a ToDo is due. |
static int |
NOTE
Field ID specifying a more complete description than the SUMMARY for this ToDo. |
static int |
PRIORITY
Field ID specifying the priority of this ToDo. |
static int |
REVISION
Field ID specifying the last modification date and time of a ToDo element. |
static int |
SUMMARY
Field ID specifying the summary or subject for this ToDo. |
static int |
UID
Field ID specifying a unique ID for a ToDo. |
Fields inherited from interface javax.microedition.pim.PIMElement |
BINARY, DATE, INT, STRING, TYPED_STRING |
Methods inherited from interface javax.microedition.pim.PIMElement |
addToCategory, commit, fromSerialFormat, getBinary, getCategories, getDate, getFieldDataType, getFieldLabel, getFields, getInt, getPIMList, getString, getTypedString, isModified, maxCategories, removeFromCategory, setBinary, setDate, setInt, setString, setTypedString, supportedSerialVersions, toSerialFormat, toSerialFormat |
Field Detail |
public static final int DUE
Value 1 is assigned to DUE
.
public static final int COMPLETED
Value 2 is assigned to COMPLETED
.
public static final int SUMMARY
Value 3 is assigned to SUMMARY
.
public static final int NOTE
Value 4 is assigned to NOTE
.
public static final int PRIORITY
Value 5 is assigned to PRIORITY
.
public static final int UID
getString(UID)
returns null
before
the event object is added to a list.
Value 6 is assigned to UID
.
public static final int REVISION
Value 7 is assigned to REVISION
.
|
PDAP 1.0 Spec, Rev. 0.16 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |