net.fortuna.ical4j.model
Class PeriodList
TreeSet
net.fortuna.ical4j.model.PeriodList
- Serializable
public class PeriodList
extends TreeSet
implements Serializable
$Id: PeriodList.java,v 1.23 2008/12/16 12:34:52 fortuna Exp $ [23-Apr-2004]
Defines a list of iCalendar periods. NOTE: By implementing the
java.util.SortedSet
interface period lists will always be
sorted according to natural ordering.
PeriodList() - Default constructor.
|
PeriodList(String aValue) - Parses the specified string representation to create a list of periods.
|
PeriodList(boolean utc)
|
boolean | add(Object arg0) - Overrides superclass to throw an
IllegalArgumentException
where argument is not a net.fortuna.ical4j.model.Period .
|
boolean | add(Period period) - Add a period to the list.
|
PeriodList | add(PeriodList periods) - A convenience method that adds all the periods in the specified list to
this list.
|
TimeZone | getTimeZone()
|
boolean | isUtc() - Indicates whether this list is in local or UTC format.
|
PeriodList | normalise() - Returns a normalised version of this period list.
|
boolean | remove(Period period) - Remove a period from the list.
|
void | setTimeZone(TimeZone timeZone) - Applies the specified timezone to all dates in the list.
|
void | setUtc(boolean utc) - Sets whether this list is in UTC or local time format.
|
PeriodList | subtract(PeriodList subtractions) - Subtracts the intersection of this list with the specified list of
periods from this list and returns the results as a new period list.
|
String | toString()
|
PeriodList
public PeriodList()
Default constructor.
PeriodList
public PeriodList(String aValue)
throws ParseException
Parses the specified string representation to create a list of periods.
aValue
- a string representation of a list of periods
PeriodList
public PeriodList(boolean utc)
add
public final boolean add(Object arg0)
Overrides superclass to throw an IllegalArgumentException
where argument is not a net.fortuna.ical4j.model.Period
.
add
public final boolean add(Period period)
Add a period to the list.
period
- the period to add
java.util.List.add(java.lang.Object)
add
public final PeriodList add(PeriodList periods)
A convenience method that adds all the periods in the specified list to
this list. Normalisation is also performed automatically after all
periods have been added.
getTimeZone
public final TimeZone getTimeZone()
isUtc
public final boolean isUtc()
Indicates whether this list is in local or UTC format.
- Returns true if in UTC format, otherwise false.
normalise
public final PeriodList normalise()
Returns a normalised version of this period list. Normalisation includes
combining overlapping periods, removing periods contained by other
periods, combining adjacent periods, and removing periods that consume
no time. NOTE: If the period list is
already normalised then this period list is returned.
remove
public final boolean remove(Period period)
Remove a period from the list.
period
- the period to remove
- true if the list contained the specified period
java.util.List.remove(java.lang.Object)
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.
setUtc
public final void setUtc(boolean utc)
Sets whether this list is in UTC or local time format.
subtract
public final PeriodList subtract(PeriodList subtractions)
Subtracts the intersection of this list with the specified list of
periods from this list and returns the results as a new period list. If
no intersection is identified this list is returned.
toString
public final String toString()
java.util.AbstractCollection.toString()