javax.microedition.pim
Interface ToDoList

All Superinterfaces:
PIMList

public interface ToDoList
extends PIMList

Represents a ToDo list containing ToDo elements.

The PIMList.isSupportedField(int) is invoked to determine if a field (as specified by the integer argument) is supported by a ToDoList. Similarly, the PIMList.getSupportedAttributes(int) method is invoked to return an integer array representing all fields supported by the list.

A ToDoList accepts only objects that implement the ToDo interface as a parameter to PIMList.items(PIMItem)). An IllegalArgumentException will be thrown if the input parameter does not implement the ToDo interface.

For more information about this class or about the personal information management (PIM) API, refer to The PDA Profile specification (JSR-000075) for the J2ME(TM) Platform.

Since:
PDAP 1.0
See Also:
ToDo, PIMList

Field Summary
 
Fields inherited from interface javax.microedition.pim.PIMList
UNCATEGORIZED
 
Method Summary
 ToDo createToDo()
          Creates a new ToDo instance.
 ToDo importToDo(ToDo element)
          Imports a ToDo into the list using a given, predefined ToDo object.
 Enumeration items(int field, long startDate, long endDate)
          Returns an enumeration containing all ToDo instances where the specified date field falls between the start date and end date inclusive.
 void removeToDo(ToDo element)
          Removes a ToDo from the list.
 
Methods inherited from interface javax.microedition.pim.PIMList
addCategory, close, deleteCategory, getArrayElementLabel, getAttributeLabel, getCategories, getFieldDataType, getFieldLabel, getName, getSupportedArrayElements, getSupportedAttributes, getSupportedFields, isCategory, isSupportedArrayElement, isSupportedAttribute, isSupportedField, items, items, items, itemsByCategory, maxCategories, maxValues, renameCategory, stringArraySize
 

Method Detail

createToDo

public ToDo createToDo()
Creates a new ToDo instance.

The new ToDo object is created initially empty and contains empty fields for all attributes that are supported by the list.

The ToDo object is not added to the ToDoList upon creation. The method PIMItem.commit() must be invoked in order to add the ToDo to the list.

Returns:
A new ToDo instance.
Since:
JDE 4.0.0

importToDo

public ToDo importToDo(ToDo element)
Imports a ToDo into the list using a given, predefined ToDo object.

The ToDo is created using as much of the existing information as possible. If a field in the existing ToDo object is not supported by the ToDoList, the field is not included in the ToDo. If the specified ToDo is already in the list, a new ToDo is created with similar information.

The ToDo object is not added to the ToDoList upon creation. The method PIMItem.commit() must be invoked in order to add the ToDo to the list.

Parameters:
element - The ToDo object to import into the list.
Returns:
The ToDo instance to add to the list.
Since:
JDE 4.0.0

items

public Enumeration items(int field,
                         long startDate,
                         long endDate)
                  throws PIMException
Returns an enumeration containing all ToDo instances where the specified date field falls between the start date and end date inclusive.

Parameters:
field - The field on which the matching is based.
startDate - The start date (in long MS format) to restrict ToDo's to.
endDate - The end date (in long MS format) to restrict ToDo's to.
Returns:
An enumeration containing all ToDo items between the two specified dates.
Throws:
PIMException - Thrown if an error occurs, or the list is no longer accessible or closed.
IllegalArgumentException - Thrown if endDate is less than startDate, or if field is not of type PIMItem.DATE.
Since:
JDE 4.0.0

removeToDo

public void removeToDo(ToDo element)
                throws PIMException
Removes a ToDo from the list.

Parameters:
element - The ToDo to be removed from the list.
Throws:
PIMException - Thrown if an error occurs, or if the ToDo cannot be found in the list.
Since:
JDE 4.0.0



Copyright 1999-2008 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.