|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EventList
Represents an Event list containing Event items.
An Event List is responsible for determining which of the fields from an
Event
are retained when an Event is persisted into the List.
An Event List does not have to retain all of the fields in an Event when the
Event is persisted into the List. See the Event
interface for a
description of the fields available for a specific Event
. The
fields that are supported by a particular Event List can be queried through
the method PIMList.isSupportedField(int)
. If a field ID that is not in the
Event
interface is provided as the parameter to the
PIMList.isSupportedField(int)
method, a
IllegalArgumentException
is thrown.
An EventList
only accepts objects implementing the
Event
interface as a parameter to PIMList.items(PIMItem)
. A
IllegalArgumentException
is thrown by this method if the input
parameter does not implement the Event
interface.
Enumerations returned by PIMList.items()
, PIMList.items(PIMItem)
, and
EventList.items(int, long, long, boolean)
contain only objects implementing an
Event
interface.
The RIM extension functionality for Event Lists are defined in
BlackBerryEventList
. Any instance of
EventList
that is retrieved from
PIM.openPIMList()
when specified
pimListType==PIM.EVENT_LIST
will be an instance of
BlackBerryEventList
and can be successfully casted to
BlackBerryEventList
, if desired, in order to use the RIM
extension functionality. When a Event
object is created by or
retrieved from a BlackBerryEventList
then it will necessarily
be an instance of BlackBerryEvent
and
will support all RIM extension fields and attributes defined therein.
Event
,
BlackBerryEventList
Field Summary | ||
---|---|---|
static int |
ENDING
Constant representing a search type for Events based on the event occurrence's specific end date/time. |
|
static int |
OCCURRING
Constant representing a search type for Events based on any occurrence of an event during a time period. |
|
static int |
STARTING
Constant representing a search type for Events based on the event occurrence's specific start date/time. |
Fields inherited from interface javax.microedition.pim.PIMList |
---|
UNCATEGORIZED |
Method Summary | ||
---|---|---|
Event |
createEvent()
Factory method to create an Event for this event list. |
|
int[] |
getSupportedRepeatRuleFields(int frequency)
Returns the Repeat Rule fields that are settable by the class user and supported by this EventList for the provided Repeat Rule
frequency. |
|
Event |
importEvent(Event event)
Imports the given Event into this list by making a new
Event for the list and filling its information with as
much information as it can from the provided Event . |
|
Enumeration |
items(int searchType,
long startDate,
long endDate,
boolean initialEventOnly)
Returns an enumeration of all the Events in this list where at least one of the Event's occurrences falls in the specified range from startDate to endDate , inclusive. |
|
void |
removeEvent(Event event)
Removes an Event 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 |
Field Detail |
---|
static final int ENDING
static final int OCCURRING
static final int STARTING
Method Detail |
---|
Event createEvent()
Event
for this event list. The
Event is empty upon creation with none of its fields containing any data
(i.e. a call to the method Event.getFields()
returns an
array of zero length). Even though it is initially empty, the Event is
capable of containing data for exactly those fields that this list
supports. Note that creation of the Event does not add the Event to the
list from which the item was created; a specific call to
PIMItem.commit()
must be made to commit the item and its data to
the list.
RIM Implementation Note: If the runtime type of this Event List
is BlackBerryEventList
then the
returned Event will be an instance of
BlackBerryEvent
and will support all
RIM extension fields and attributes defined in
BlackBerryEvent
; if desired, the returned Event may be
casted to BlackBerryEvent
to use any RIM extension methods
defined there.
Event
object associated with this
list. However, the Event
is still not persistent
in the list until a call to Event.commit()
for the
Event
is made.EventList.importEvent(Event)
,
EventList.removeEvent(Event)
int[] getSupportedRepeatRuleFields(int frequency)
EventList
for the provided Repeat Rule
frequency. Repeat Rule frequencies are RepeatRule.YEARLY
,
RepeatRule.MONTHLY
, RepeatRule.WEEKLY
, and
RepeatRule.DAILY
.
The int values in the returned array represent a bitwise combination of
Repeat Rule fields that are valid for the given frequency. For example,
if MONTHLY
was the frequency and this event list supported
specifying monthly repeat rules by either the day of the month or by a
day in a specific week (e.g. Thursday of the 3rd week in the month), then
the returned int array would contain two elements with one value being
DAY_IN_MONTH
and the other being
DAY_IN_WEEK|WEEK_IN_MONTH
. All possible field
combinations that are valid are returned in the array.
If the given frequency is not supported by this list, a zero-length array
is returned. If the frequency is supported but no fields are supported by
this list for that frequency, a one item array containing the integer
0
(zero) is returned. In these conditions, any field that
has a value set will be ignored by this event list.
frequency
- Repeat Rule frequency for which the supported fields are
queried.
IllegalArgumentException
- if frequency
is not one of
RepeatRule.YEARLY
,
RepeatRule.MONTHLY
,
RepeatRule.WEEKLY
, or
RepeatRule.DAILY
.RepeatRule
Event importEvent(Event event)
Event
into this list by making a new
Event
for the list and filling its information with as
much information as it can from the provided Event
. If
the input Event
is already in the list, a new
Event
is still created with information similar to the
input item (but not necessarily identical).
Note that not all data from the input Event
may be
supported in the new Event
due to field restrictions for
the list instance. In this case, data fields not supported are not
transferred to the new Event
object.
Also note that creation of the Event
does not add the
Event
to this list; a specific call to
Event.commit()
must be made to commit the item and its
data to the list.
RIM Implementation Note: If the runtime type of this Event List
is BlackBerryEventList
then the
returned Event will be an instance of
BlackBerryEvent
and will support all
RIM extension fields and attributes defined in
BlackBerryEvent
; if desired, the returned Event may be
casted to BlackBerryEvent
to use any RIM extension methods
defined there.
event
- the Event to import into the list.
Event
, as defined above.
NullPointerException
- if event
is null.EventList.createEvent()
,
EventList.removeEvent(Event)
Enumeration items(int searchType, long startDate, long endDate, boolean initialEventOnly) throws PIMException
startDate
to endDate
, inclusive.
The specified "search type" determines the criteria for matching an event
occurrence; STARTING
searches for events starting between
startDate
and endDate
, ENDING
searches for events ending between startDate
and
endDate
, and OCCURRING
searches for events
that have any part of the event occurring during the period specified by
startDate
and endDate
. The returned Events
are sorted in ascending order by the starting date-timestamp of the
event's occurrence. An Event
is returned in the
Enumeration
only once if the event occurs more than once
during the specified time interval.
searchType
- the criteria used to determine which Events are returned;
must be one of EventList.STARTING
, EventList.ENDING
, or
EventList.OCCURRING
.startDate
- the inclusive start date to begin looking for event
occurrences on or after this date, returned in
milliseconds since the epoch (00:00:00 GMT, January 1,
1970)endDate
- the inclusive end date to stop looking for events beyond
this date, returned in milliseconds since the epoch
(00:00:00 GMT, January 1, 1970)initialEventOnly
- if true
then only search based on an
Event's START
and END
values
and do not calculate repeating occurrences of the event;
if false
then repeating occurrences of an
Event
are included during the search.
PIMException
- If an error occurs or the list is no longer accessible or
closed.
SecurityException
- if the application is not given permission to read the
PIM list or the list is opened WRITE_ONLY
.PIMList.items()
,
PIMList.items(PIMItem)
,
PIMList.items(String)
,
PIMList.itemsByCategory(String)
void removeEvent(Event event) throws PIMException
Event
from the list. The item must already
exist in the list for this method to succeed.
event
- the Event
to be removed from the list.
PIMException
- If an error occurs deleting the item or the list is no
longer accessible or closed.
NullPointerException
- If event
is null.
SecurityException
- if the application is not given permission to write to
the Event list or the list is opened
READ_ONLY
.EventList.createEvent()
,
EventList.importEvent(Event)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal