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>
public class DateList extends Object implements List<Date>, Serializable, Iterable<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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DateList()Default constructor.DateList(boolean unmodifiable)DateList(String aValue, Value aType)DateList(String aValue, Value aType, TimeZone timezone)Parses the specified string representation to create a list of dates.DateList(DateList list, Value type)Constructs a new date list of the specified type containing the dates in the specified list.DateList(Value aType)DateList(Value aType, TimeZone timezone)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int arg0, Date arg1)booleanadd(Date date)Add a date to the list.booleanaddAll(int arg0, Collection<? extends Date> arg1)booleanaddAll(Collection<? extends Date> arg0)voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> arg0)booleanequals(Object obj)Dateget(int index)TimeZonegetTimeZone()ValuegetType()Returns the VALUE parameter specifying the type of dates (ie.inthashCode()intindexOf(Object o)booleanisEmpty()booleanisUtc()Indicates whether this list is in local or UTC format.Iterator<Date>iterator()intlastIndexOf(Object o)ListIterator<Date>listIterator()ListIterator<Date>listIterator(int index)Dateremove(int index)booleanremove(Object o)booleanremove(Date date)Remove a date from the list.booleanremoveAll(Collection<?> arg0)booleanretainAll(Collection<?> arg0)Dateset(int arg0, Date arg1)voidsetTimeZone(TimeZone timeZone)Applies the specified timezone to all dates in the list.voidsetUtc(boolean utc)Sets whether this list is in UTC or local time format.intsize()List<Date>subList(int fromIndex, int toIndex)Object[]toArray()<T> T[]toArray(T[] arg0)StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
replaceAll, sort, spliterator
-
-
-
-
Constructor Detail
-
DateList
public DateList()
Default constructor.
-
DateList
public DateList(boolean unmodifiable)
-
DateList
public DateList(Value aType)
- Parameters:
aType- the type of dates contained by the instance
-
DateList
public DateList(Value aType, TimeZone timezone)
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
public DateList(String aValue, Value aType) throws ParseException
- 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
public DateList(String aValue, Value aType, TimeZone timezone) throws ParseException
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
-
-
Method Detail
-
add
public final boolean add(Date date)
Add a date to the list. The date will be updated to reflect the timezone of this list.- Specified by:
addin interfaceCollection<Date>- Specified by:
addin interfaceList<Date>- Parameters:
date- the date to add- Returns:
- true
- See Also:
List.add(java.lang.Object)
-
remove
public final boolean remove(Date date)
Remove a date from the list.- Parameters:
date- the date to remove- Returns:
- true if the list contained the specified date
- See Also:
List.remove(java.lang.Object)
-
getType
public final Value 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
public final void setTimeZone(TimeZone timeZone)
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
public final TimeZone getTimeZone()
- Returns:
- Returns the timeZone.
-
addAll
public final boolean addAll(Collection<? extends Date> arg0)
-
addAll
public final boolean addAll(int arg0, Collection<? extends Date> arg1)
-
clear
public final void clear()
-
contains
public final boolean contains(Object o)
-
containsAll
public final boolean containsAll(Collection<?> arg0)
- Specified by:
containsAllin interfaceCollection<Date>- Specified by:
containsAllin interfaceList<Date>
-
isEmpty
public final boolean isEmpty()
-
lastIndexOf
public final int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<Date>
-
listIterator
public final ListIterator<Date> listIterator()
- Specified by:
listIteratorin interfaceList<Date>
-
listIterator
public final ListIterator<Date> listIterator(int index)
- Specified by:
listIteratorin interfaceList<Date>
-
remove
public final boolean remove(Object o)
-
removeAll
public final boolean removeAll(Collection<?> arg0)
-
retainAll
public final boolean retainAll(Collection<?> arg0)
-
size
public final int size()
-
toArray
public final Object[] toArray()
-
toArray
public final <T> T[] toArray(T[] arg0)
-
equals
public final boolean equals(Object obj)
-
-