Class DateProperty
java.lang.Object
net.fortuna.ical4j.model.Content
net.fortuna.ical4j.model.Property
net.fortuna.ical4j.model.property.DateProperty
- All Implemented Interfaces:
Serializable,Comparable<Property>,FluentProperty
- Direct Known Subclasses:
DtEnd,DtStart,Due,RecurrenceId,UtcProperty
$Id$
Created on 9/07/2005
Base class for properties with a DATE or DATE-TIME value. Note that some sub-classes may only allow either a DATE or
a DATE-TIME value, for which additional rules/validation should be specified.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class net.fortuna.ical4j.model.Content
Content.Factory -
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
ConstructorsConstructorDescriptionDateProperty(String name, ParameterList parameters, PropertyFactory factory) DateProperty(String name, PropertyFactory factory) DateProperty(String name, TimeZone timezone, PropertyFactory factory) Creates a new instance of the named property with an initial timezone. -
Method Summary
Modifier and TypeMethodDescriptionintcopy()Create a (deep) copy of this property.final DategetDate()final TimeZonegetValue()inthashCode()final booleanisUtc()Indicates whether the current date value is specified in UTC time.final voidSets the date value of this property.voidsetTimeZone(TimeZone timezone) Publically available method to update the current timezone.final voidsetUtc(boolean utc) Resets the VTIMEZONE associated with the property.voidDefault setValue() implementation.validate()Perform validation on a property.Methods inherited from class net.fortuna.ical4j.model.Property
equals, getFluentTarget, getName, getParameter, getParameters, getParameters, 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
-
DateProperty
- Parameters:
name- the property nameparameters- a list of initial parameters
-
DateProperty
- Parameters:
name- the property name
-
DateProperty
Creates a new instance of the named property with an initial timezone.- Parameters:
name- property nametimezone- initial timezone
-
-
Method Details
-
getDate
- Returns:
- Returns the date.
-
setDate
Sets the date value of this property. The timezone and value of this instance will also be updated accordingly.- Parameters:
date- The date to set.
-
setValue
Default setValue() implementation. Allows for either DATE or DATE-TIME values.- Specified by:
setValuein classProperty- Parameters:
value- a string representation of a DATE or DATE-TIME value- Throws:
ParseException- where the specified value is not a valid DATE or DATE-TIME representation
-
getValue
-
setTimeZone
Publically available method to update the current timezone.- Parameters:
timezone- a timezone instance
-
getTimeZone
- Returns:
- the timezone
-
hashCode
public int hashCode() -
setUtc
public final void setUtc(boolean utc) Resets the VTIMEZONE associated with the property. If utc is true, any TZID parameters are removed and the Java timezone is updated to UTC time. If utc is false, TZID parameters are removed and the Java timezone is set to the default timezone (i.e. represents a "floating" local time)- Parameters:
utc- a UTC value
-
isUtc
public final boolean isUtc()Indicates whether the current date value is specified in UTC time.- Returns:
- true if the property is in UTC time, otherwise false
-
validate
Perform validation on a property.- Specified by:
validatein classProperty- Throws:
ValidationException- where the property is not in a valid state
-
copy
Create a (deep) copy of this property.- Overrides:
copyin classProperty- Returns:
- the copy of the property
- Throws:
IOException- where an error occurs reading property dataURISyntaxException- where the property contains an invalid URI valueParseException- where the property contains an invalid date value
-
compareTo
- Specified by:
compareToin interfaceComparable<Property>- Overrides:
compareToin classProperty
-