Package net.fortuna.ical4j.model
Class DateList
java.lang.Object
net.fortuna.ical4j.model.DateList
- All Implemented Interfaces:
Serializable,Iterable<Date>,Collection<Date>,List<Date>
$Id$ [23-Apr-2004]
Defines a list of iCalendar dates. If no value type is specified a list
defaults to DATE-TIME instances.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidfinal booleanAdd a date to the list.final booleanaddAll(int arg0, Collection<? extends Date> arg1) final booleanaddAll(Collection<? extends Date> arg0) final voidclear()final booleanfinal booleancontainsAll(Collection<?> arg0) final booleanfinal Dateget(int index) final TimeZonefinal ValuegetType()Returns the VALUE parameter specifying the type of dates (ie.final inthashCode()final intfinal booleanisEmpty()final booleanisUtc()Indicates whether this list is in local or UTC format.iterator()final intfinal ListIterator<Date>final ListIterator<Date>listIterator(int index) final Dateremove(int index) final booleanfinal booleanRemove a date from the list.final booleanremoveAll(Collection<?> arg0) final booleanretainAll(Collection<?> arg0) final Datefinal voidsetTimeZone(TimeZone timeZone) Applies the specified timezone to all dates in the list.final voidsetUtc(boolean utc) Sets whether this list is in UTC or local time format.final intsize()subList(int fromIndex, int toIndex) final Object[]toArray()final <T> T[]toArray(T[] arg0) final StringtoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
replaceAll, sort, spliterator
-
Constructor Details
-
DateList
public DateList()Default constructor. -
DateList
public DateList(boolean unmodifiable) -
DateList
- Parameters:
aType- the type of dates contained by the instance
-
DateList
Default constructor.- Parameters:
aType- specifies the type of dates (either date or date-time)timezone- the timezone to apply to dates contained by the instance
-
DateList
- Parameters:
aValue- a string representation of a date listaType- the date types contained in the instance- Throws:
ParseException- where the specified string is not a valid date list
-
DateList
Parses the specified string representation to create a list of dates.- Parameters:
aValue- a string representation of a list of datesaType- specifies the type of dates (either date or date-time)timezone- the timezone to apply to contained dates- Throws:
ParseException- if an invalid date representation exists in the date list string
-
DateList
Constructs a new date list of the specified type containing the dates in the specified list.- Parameters:
list- a list of dates to include in the new listtype- the type of the new list
-
-
Method Details
-
toString
-
add
Add a date to the list. The date will be updated to reflect the timezone of this list. -
remove
Remove a date from the list.- Parameters:
date- the date to remove- Returns:
- true if the list contained the specified date
- See Also:
-
getType
Returns the VALUE parameter specifying the type of dates (ie. date or date-time) stored in this date list.- Returns:
- Returns a Value parameter.
-
isUtc
public final boolean isUtc()Indicates whether this list is in local or UTC format. This property will have no affect if the type of the list is not DATE-TIME.- Returns:
- Returns true if in UTC format, otherwise false.
-
setUtc
public final void setUtc(boolean utc) Sets whether this list is in UTC or local time format.- Parameters:
utc- The utc to set.
-
setTimeZone
Applies the specified timezone to all dates in the list. All dates added to this list will also have this timezone applied.- Parameters:
timeZone- a timezone to apply to contained dates
-
getTimeZone
- Returns:
- Returns the timeZone.
-
add
-
addAll
-
addAll
-
clear
public final void clear() -
contains
-
containsAll
- Specified by:
containsAllin interfaceCollection<Date>- Specified by:
containsAllin interfaceList<Date>
-
get
-
indexOf
-
isEmpty
public final boolean isEmpty() -
iterator
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<Date>
-
listIterator
- Specified by:
listIteratorin interfaceList<Date>
-
listIterator
- Specified by:
listIteratorin interfaceList<Date>
-
remove
-
remove
-
removeAll
-
retainAll
-
set
-
size
public final int size() -
subList
-
toArray
-
toArray
public final <T> T[] toArray(T[] arg0) -
equals
-
hashCode
public final int hashCode()
-