java.lang.Object
net.fortuna.ical4j.model.Content
net.fortuna.ical4j.model.Property
net.fortuna.ical4j.model.property.Duration
- All Implemented Interfaces:
Serializable,Comparable<Property>,FluentProperty,Prototype<Property>
$Id$
Created: [Apr 6, 2004]
Defines a DURATION iCalendar component property.
3.3.6. Duration Value Name: DURATION Purpose: This value type is used to identify properties that contain a duration of time. Format Definition: This value type is defined by the following notation: dur-value = (["+"] / "-") "P" (dur-date / dur-time / dur-week) dur-date = dur-day [dur-time] dur-time = "T" (dur-hour / dur-minute / dur-second) dur-week = 1*DIGIT "W" dur-hour = 1*DIGIT "H" [dur-minute] dur-minute = 1*DIGIT "M" [dur-second] dur-second = 1*DIGIT "S" dur-day = 1*DIGIT "D" Description: If the property permits, multiple "duration" values are specified by a COMMA-separated list of values. The format is based on the [ISO.8601.2004] complete representation basic format with designators for the duration of time. The format can represent nominal durations (weeks and days) and accurate durations (hours, minutes, and seconds). Note that unlike [ISO.8601.2004], this value type doesn't support the "Y" and "M" designators to specify durations in terms of years and months. The duration of a week or a day depends on its position in the calendar. In the case of discontinuities in the time scale, such as the change from standard time to daylight time and back, the computation of the exact duration requires the subtraction or addition of the change of duration of the discontinuity. Leap seconds MUST NOT be considered when computing an exact duration. When computing an exact duration, the greatest order time components MUST be added first, that is, the number of days MUST be added first, followed by the number of hours, number of minutes, and number of seconds. Negative durations are typically used to schedule an alarm to trigger before an associated time (see Section 3.8.6.3). No additional content value encoding (i.e., BACKSLASH character encoding, see Section 3.3.11) are defined for this value type. Example: A duration of 15 days, 5 hours, and 20 seconds would be: P15DT5H0M20S A duration of 7 weeks would be: P7W
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class net.fortuna.ical4j.model.Property
ACKNOWLEDGED, ACTION, ATTACH, ATTENDEE, BUSYTYPE, CALENDAR_ADDRESS, CALSCALE, CATEGORIES, CLASS, COMMENT, COMPLETED, CONTACT, COUNTRY, CREATED, DESCRIPTION, DTEND, DTSTAMP, DTSTART, DUE, DURATION, EXDATE, EXPERIMENTAL_PREFIX, EXRULE, EXTENDED_ADDRESS, FREEBUSY, GEO, LAST_MODIFIED, LOCALITY, LOCATION, LOCATION_TYPE, METHOD, NAME, ORGANIZER, PARTICIPANT_TYPE, PERCENT_COMPLETE, POSTALCODE, PRIORITY, PRODID, PROXIMITY, RDATE, RECURRENCE_ID, REGION, RELATED_TO, REPEAT, REQUEST_STATUS, RESOURCE_TYPE, RESOURCES, RRULE, SEQUENCE, STATUS, STREET_ADDRESS, STRUCTURED_DATA, STYLED_DESCRIPTION, SUMMARY, TEL, TRANSP, TRIGGER, TZID, TZID_ALIAS_OF, TZNAME, TZOFFSETFROM, TZOFFSETTO, TZUNTIL, TZURL, UID, URL, VERSION, XML -
Constructor Summary
ConstructorsConstructorDescriptionDuration()Default constructor.Duration(TemporalAmount duration) Constructs a new duration representing the time between the specified start date and end date.Deprecated.Deprecated.Duration(ParameterList aList, String aValue) Duration(ParameterList aList, TemporalAmount duration) Duration(ParameterList aList, Dur duration) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionfinal TemporalAmountfinal StringgetValue()protected PropertyFactory<Duration>Returns a new property factory used to create deep copies.final voidsetDuration(TemporalAmount duration) final voidSets the current value of the property.validate()Perform validation on a property.Methods inherited from class net.fortuna.ical4j.model.Property
add, compareTo, copy, equals, getFluentTarget, getName, getParameter, getParameter, getParameterList, getParameters, getPrefix, getRequiredParameter, getRequiredParameter, hashCode, remove, removeAll, replace, setParameters, setPrefix, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.fortuna.ical4j.model.FluentProperty
withParameter
-
Constructor Details
-
Duration
public Duration()Default constructor. -
Duration
-
Duration
- Parameters:
aList- a list of parameters for this componentaValue- a value string for this component
-
Duration
Deprecated.- Parameters:
duration- a duration value
-
Duration
- Parameters:
duration- a duration value
-
Duration
Deprecated.- Parameters:
aList- a list of parameters for this componentduration- a duration value
-
Duration
- Parameters:
aList- a list of parameters for this componentduration- a duration value
-
Duration
Deprecated.Constructs a new duration representing the time between the specified start date and end date.- Parameters:
start- the starting time for the durationend- the end time for the duration
-
Duration
Constructs a new duration representing the time between the specified start date and end date.- Parameters:
start- the starting time for the durationend- the end time for the duration
-
-
Method Details
-
getDuration
- Returns:
- Returns the duration.
-
setValue
Sets the current value of the property. -
getValue
-
setDuration
- Parameters:
duration- The duration to set.
-
validate
Description copied from class:PropertyPerform validation on a property.- Specified by:
validatein classProperty- Throws:
ValidationException- where the property is not in a valid state
-
newFactory
Description copied from class:PropertyReturns a new property factory used to create deep copies.- Specified by:
newFactoryin classProperty- Returns:
- a property factory instance
-
Duration(Temporal, Temporal)