Top Description Inners Fields Constructors Methods
net.fortuna.ical4j.model.component

public Class VToDo

extends CalendarComponent
implements Prototype<VToDo>, ComponentContainer<Component>, RecurrenceSupport<VToDo>, DescriptivePropertyAccessor, ChangeManagementPropertyAccessor, DateTimePropertyAccessor, RelationshipPropertyAccessor, AlarmsAccessor, ParticipantsAccessor, LocationsAccessor, ResourcesAccessor
Class Inheritance
All Implemented Interfaces
net.fortuna.ical4j.model.ResourcesAccessor, net.fortuna.ical4j.model.ComponentContainer, net.fortuna.ical4j.model.ComponentListAccessor, net.fortuna.ical4j.model.LocationsAccessor, net.fortuna.ical4j.model.ParticipantsAccessor, net.fortuna.ical4j.model.AlarmsAccessor, net.fortuna.ical4j.model.RelationshipPropertyAccessor, net.fortuna.ical4j.model.PropertyContainer, net.fortuna.ical4j.model.PropertyListAccessor, net.fortuna.ical4j.model.DateTimePropertyAccessor, net.fortuna.ical4j.model.ChangeManagementPropertyAccessor, net.fortuna.ical4j.model.DescriptivePropertyAccessor, net.fortuna.ical4j.model.RecurrenceSupport, net.fortuna.ical4j.model.Prototype
Imports
net.fortuna.ical4j.model.*, net.fortuna.ical4j.model.property.*, net.fortuna.ical4j.validate.*, net.fortuna.ical4j.validate.component.VToDoValidator, org.apache.commons.lang3.builder.HashCodeBuilder, java.time.temporal.Temporal, .TemporalAmount, java.util.HashMap, .Map, .Objects, .Optional, java.util.stream.Collectors

$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);
Author
Ben Fortuna

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private static final Map<Method, Validator<VToDo>>
private static final long
Inherited from net.fortuna.ical4j.model.component.CalendarComponent:
EMPTY_VALIDATOR

Constructor Summary

AccessConstructor and Description
public
VToDo()

Default constructor.

public
VToDo(boolean initialise)

public
VToDo(final PropertyList
a list of properties
properties
)

Constructor.

public
VToDo(PropertyList properties, ComponentList<VAlarm> alarms)

public
VToDo(final Temporal
the start date of the new todo
start
,
final String
the todo summary
summary
)

Constructs a new VTODO instance starting at the specified time with the specified summary.

public
VToDo(final Temporal
the start date of the new todo
start
,
final Temporal
the due date of the new todo
due
,
final String
the todo summary
summary
)

Constructs a new VTODO instance starting and ending at the specified times with the specified summary.

public
VToDo(final Temporal
the start date of the new todo
start
,
final TemporalAmount
the duration of the new todo
duration
,
final String
the todo summary
summary
)

Constructs a new VTODO instance starting at the specified times, for the specified duration, with the specified summary.

Method Summary

Modifier and TypeMethod and Description
public VToDo
copy()

Overrides net.fortuna.ical4j.model.Component.copy.

Implements net.fortuna.ical4j.model.Prototype.copy.

Create a (deep) copy of this component.

public boolean
equals(final Object
the reference object with which to compare.
arg0
)

Overrides net.fortuna.ical4j.model.Component.equals.

Indicates whether some other object is "equal to" this one.

public ComponentList<Component>

Returns:

Returns the underlying component list.
getComponentList
()

Implements net.fortuna.ical4j.model.ComponentListAccessor.getComponentList.

public final Optional<Completed>

Returns:

the optional date completed property
getDateCompleted
()

public final Optional<DtStamp>

Returns:

the date-stamp property
getDateStamp
()

public final <T extends Temporal> Optional<Due<T>>

Returns:

the optional due property
getDue
()

public final <T extends Temporal> Optional<DtStart<T>>

Returns:

The DtStart object representation of the start Date
getStartDate
()

Convenience method to pull the DTSTART out of the property list.

public int
hashCode()

Overrides net.fortuna.ical4j.model.Component.hashCode.

Returns a hash code value for this object.

protected ComponentFactory<VToDo>
newFactory()

Implements abstract net.fortuna.ical4j.model.Component.newFactory.

Returns a new component factory used to create deep copies.

public void
public ValidationResult
validate(final boolean
indicates whether to validate the component's properties
recurse
)

Implements abstract net.fortuna.ical4j.model.Component.validate.

Perform validation on a component.

public ValidationResult
validate(Method
the applicable method
method
)

Overrides net.fortuna.ical4j.model.component.CalendarComponent.validate.

Performs method-specific ITIP validation.

Inherited from net.fortuna.ical4j.model.component.CalendarComponent:
validateAddvalidateCancelvalidateCountervalidateDeclineCountervalidatePublishvalidateRefreshvalidateReplyvalidateRequest

Field Detail

methodValidatorsback to summary
private static final Map<Method, Validator<VToDo>> methodValidators
serialVersionUIDback to summary
private static final long serialVersionUID

Hides net.fortuna.ical4j.model.component.CalendarComponent.serialVersionUID.

Constructor Detail

VToDoback to summary
public VToDo()

Default constructor.

VToDoback to summary
public VToDo(boolean initialise)
VToDoback to summary
public VToDo(final PropertyList properties)

Constructor.

Parameters
properties:PropertyList

a list of properties

VToDoback to summary
public VToDo(PropertyList properties, ComponentList<VAlarm> alarms)
VToDoback to summary
public VToDo(final Temporal start, final String summary)

Constructs a new VTODO instance starting at the specified time with the specified summary.

Parameters
start:Temporal

the start date of the new todo

summary:String

the todo summary

VToDoback to summary
public VToDo(final Temporal start, final Temporal due, final String summary)

Constructs a new VTODO instance starting and ending at the specified times with the specified summary.

Parameters
start:Temporal

the start date of the new todo

due:Temporal

the due date of the new todo

summary:String

the todo summary

VToDoback to summary
public VToDo(final Temporal start, final TemporalAmount duration, final String summary)

Constructs a new VTODO instance starting at the specified times, for the specified duration, with the specified summary.

Parameters
start:Temporal

the start date of the new todo

duration:TemporalAmount

the duration of the new todo

summary:String

the todo summary

Method Detail

copyback to summary
public VToDo copy()

Overrides net.fortuna.ical4j.model.Component.copy.

Implements net.fortuna.ical4j.model.Prototype.copy.

Doc from net.fortuna.ical4j.model.Component.copy.

Create a (deep) copy of this component.

Returns:VToDo

the component copy

Annotations
@Override
equalsback to summary
public boolean equals(final Object arg0)

Overrides net.fortuna.ical4j.model.Component.equals.

Doc from net.fortuna.ical4j.model.Component.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
arg0:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getComponentListback to summary
public ComponentList<Component> getComponentList()

Implements net.fortuna.ical4j.model.ComponentListAccessor.getComponentList.

Returns:ComponentList<Component>

Returns the underlying component list.

Annotations
@Override
getDateCompletedback to summary
public final Optional<Completed> getDateCompleted()
Returns:Optional<Completed>

the optional date completed property

Annotations
@Deprecated
getDateStampback to summary
public final Optional<DtStamp> getDateStamp()
Returns:Optional<DtStamp>

the date-stamp property

Annotations
@Deprecated
getDueback to summary
public final <T extends Temporal> Optional<Due<T>> getDue()
Returns:Optional<Due<T>>

the optional due property

Annotations
@Deprecated
getStartDateback to summary
public final <T extends Temporal> Optional<DtStart<T>> getStartDate()

Convenience method to pull the DTSTART out of the property list.

Returns:Optional<DtStart<T>>

The DtStart object representation of the start Date

Annotations
@Deprecated
hashCodeback to summary
public int hashCode()

Overrides net.fortuna.ical4j.model.Component.hashCode.

Doc from net.fortuna.ical4j.model.Component.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object

Annotations
@Override
newFactoryback to summary
protected ComponentFactory<VToDo> newFactory()

Implements abstract net.fortuna.ical4j.model.Component.newFactory.

Doc from net.fortuna.ical4j.model.Component.newFactory.

Returns a new component factory used to create deep copies.

Returns:ComponentFactory<VToDo>

a component factory instance

Annotations
@Override
setComponentListback to summary
public void setComponentList(ComponentList<Component> components)

Implements net.fortuna.ical4j.model.ComponentContainer.setComponentList.

Annotations
@Override
validateback to summary
public ValidationResult validate(final boolean recurse) throws ValidationException

Implements abstract net.fortuna.ical4j.model.Component.validate.

Doc from net.fortuna.ical4j.model.Component.validate.

Perform validation on a component.

Parameters
recurse:boolean

indicates whether to validate the component's properties

Annotations
@Override
Exceptions
ValidationException:
where the component is not in a valid state
validateback to summary
public ValidationResult validate(Method method) throws ValidationException

Overrides net.fortuna.ical4j.model.component.CalendarComponent.validate.

Performs method-specific ITIP validation.

Parameters
method:Method

the applicable method

Annotations
@Override
Exceptions
ValidationException:
where the component does not comply with RFC2446
net.fortuna.ical4j.model.component back to summary

public Class VToDo.Factory

extends Factory
implements ComponentFactory<VToDo>
Class Inheritance
All Implemented Interfaces
net.fortuna.ical4j.model.ComponentFactory

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public VToDo
public VToDo
public VToDo
Inherited from net.fortuna.ical4j.model.Content.Factory:
supports

Constructor Detail

Factoryback to summary
public Factory()

Method Detail

createComponentback to summary
public VToDo createComponent()

Implements net.fortuna.ical4j.model.ComponentFactory.createComponent.

Annotations
@Override
createComponentback to summary
public VToDo createComponent(PropertyList properties)

Implements net.fortuna.ical4j.model.ComponentFactory.createComponent.

Annotations
@Override
createComponentback to summary
public VToDo createComponent(PropertyList properties, ComponentList<?> subComponents)

Overrides default net.fortuna.ical4j.model.ComponentFactory.createComponent.

Annotations
@Override
@SuppressWarnings:unchecked