Class VToDo
java.lang.Object
net.fortuna.ical4j.model.Component
net.fortuna.ical4j.model.component.CalendarComponent
net.fortuna.ical4j.model.component.VToDo
- All Implemented Interfaces:
Serializable,ComponentContainer<Component>,FluentComponent,PropertyContainer,RecurrenceSupport<VToDo>
public class VToDo
extends CalendarComponent
implements ComponentContainer<Component>, RecurrenceSupport<VToDo>
$Id$ [Apr 5, 2004]
Defines an iCalendar VTODO component.
4.6.2 To-do Component
Component Name: VTODO
Purpose: Provide a grouping of calendar properties that describe a
to-do.
Formal Definition: A "VTODO" calendar component is defined by the
following notation:
todoc = "BEGIN" ":" "VTODO" CRLF
todoprop *alarmc
"END" ":" "VTODO" CRLF
todoprop = *(
; the following are optional,
; but MUST NOT occur more than once
class / completed / created / description / dtstamp /
dtstart / geo / last-mod / location / organizer /
percent / priority / recurid / seq / status /
summary / uid / url /
; either 'due' or 'duration' may appear in
; a 'todoprop', but 'due' and 'duration'
; MUST NOT occur in the same 'todoprop'
due / duration /
; the following are optional,
; and MAY occur more than once
attach / attendee / categories / comment / contact /
exdate / exrule / rstatus / related / resources /
rdate / rrule / x-prop
)
Example 1 - Creating a todo of two (2) hour duration starting tomorrow:
java.util.Calendar cal = java.util.Calendar.getInstance();
// tomorrow..
cal.add(java.util.Calendar.DAY_OF_MONTH, 1);
cal.set(java.util.Calendar.HOUR_OF_DAY, 11);
cal.set(java.util.Calendar.MINUTE, 00);
VToDo documentation = new VEvent(cal.getTime(), 1000 * 60 * 60 * 2,
"Document calendar component usage");
// add timezone information..
VTimeZone tz = VTimeZone.getDefault();
TzId tzParam = new TzId(tz.getProperties().getProperty(Property.TZID)
.getValue());
documentation.getProperties().getProperty(Property.DTSTART).getParameters()
.add(tzParam);
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class net.fortuna.ical4j.model.component.CalendarComponent
EMPTY_VALIDATORFields inherited from class net.fortuna.ical4j.model.Component
AVAILABLE, BEGIN, components, END, EXPERIMENTAL_PREFIX, PARTICIPANT, VALARM, VAVAILABILITY, VEVENT, VFREEBUSY, VJOURNAL, VLOCATION, VRESOURCE, VTIMEZONE, VTODO, VVENUE -
Constructor Summary
ConstructorsConstructorDescriptionVToDo()Default constructor.VToDo(boolean initialise) Constructs a new VTODO instance starting at the specified time with the specified summary.VToDo(Date start, TemporalAmount duration, String summary) Constructs a new VTODO instance starting at the specified times, for the specified duration, with the specified summary.Constructs a new VTODO instance starting and ending at the specified times with the specified summary.VToDo(PropertyList properties) Constructor.VToDo(PropertyList properties, ComponentList<VAlarm> alarms) -
Method Summary
Modifier and TypeMethodDescriptionbooleanfinal ComponentList<VAlarm>Returns the list of alarms for this todo.final Clazzfinal Createdfinal Completedfinal DtStampfinal Descriptionfinal DuegetDue()final Durationfinal Geofinal LastModifiedfinal Locationfinal Organizerfinal PercentCompletefinal Priorityfinal RecurrenceIdfinal Sequencefinal DtStartConvenience method to pull the DTSTART out of the property list.final Statusfinal Summaryfinal UidgetUid()Returns the UID property of this component if available.final UrlgetUrl()protected ValidatorgetValidator(Method method) inthashCode()validate(boolean recurse) Perform validation on a component.Methods inherited from class net.fortuna.ical4j.model.component.CalendarComponent
validate, validateAdd, validateCancel, validateCounter, validateDeclineCounter, validatePublish, validateRefresh, validateReply, validateRequestMethods inherited from class net.fortuna.ical4j.model.Component
calculateRecurrenceSet, copy, getFluentTarget, getName, getProperties, getRequiredProperty, toString, validate, validatePropertiesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.fortuna.ical4j.model.ComponentContainer
getComponent, getComponentsMethods inherited from interface net.fortuna.ical4j.model.FluentComponent
withPropertyMethods inherited from interface net.fortuna.ical4j.model.PropertyContainer
getProperties, getProperties, getPropertyMethods inherited from interface net.fortuna.ical4j.model.RecurrenceSupport
calculateRecurrenceSet, copy, getOccurrences
-
Constructor Details
-
VToDo
public VToDo()Default constructor. -
VToDo
public VToDo(boolean initialise) -
VToDo
Constructor.- Parameters:
properties- a list of properties
-
VToDo
-
VToDo
Constructs a new VTODO instance starting at the specified time with the specified summary.- Parameters:
start- the start date of the new todosummary- the todo summary
-
VToDo
Constructs a new VTODO instance starting and ending at the specified times with the specified summary.- Parameters:
start- the start date of the new tododue- the due date of the new todosummary- the todo summary
-
VToDo
Constructs a new VTODO instance starting at the specified times, for the specified duration, with the specified summary.- Parameters:
start- the start date of the new tododuration- the duration of the new todosummary- the todo summary
-
-
Method Details
-
getAlarms
Returns the list of alarms for this todo.- Returns:
- a component list
-
getComponents
- Specified by:
getComponentsin interfaceComponentContainer<Component>
-
validate
Perform validation on a component.- Specified by:
validatein classComponent- Parameters:
recurse- indicates whether to validate the component's properties- Throws:
ValidationException- where the component is not in a valid state
-
getValidator
- Specified by:
getValidatorin classCalendarComponent- Parameters:
method- a method to validate on- Returns:
- a validator for the specified method or null if the method is not supported
-
getClassification
- Returns:
- the optional access classification property
-
getDateCompleted
- Returns:
- the optional date completed property
-
getCreated
- Returns:
- the optional creation-time property
-
getDescription
- Returns:
- the optional description property
-
getStartDate
Convenience method to pull the DTSTART out of the property list.- Returns:
- The DtStart object representation of the start Date
-
getGeographicPos
- Returns:
- the optional geographic position property
-
getLastModified
- Returns:
- the optional last-modified property
-
getLocation
- Returns:
- the optional location property
-
getOrganizer
- Returns:
- the optional organizer property
-
getPercentComplete
- Returns:
- the optional percentage complete property
-
getPriority
- Returns:
- the optional priority property
-
getDateStamp
- Returns:
- the optional date-stamp property
-
getSequence
- Returns:
- the optional sequence number property
-
getStatus
- Returns:
- the optional status property
-
getSummary
- Returns:
- the optional summary property
-
getUrl
- Returns:
- the optional URL property
-
getRecurrenceId
- Returns:
- the optional recurrence identifier property
-
getDuration
- Returns:
- the optional Duration property
-
getDue
- Returns:
- the optional due property
-
getUid
Returns the UID property of this component if available.- Returns:
- a Uid instance, or null if no UID property exists
-
equals
-
hashCode
public int hashCode()
-