|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.fortuna.ical4j.model.DateRange
net.fortuna.ical4j.model.Period
public class Period
$Id$ [Apr 14, 2004] Defines a period of time. A period may be specified as either a start date and end date, or a start date and duration. NOTE: End dates and durations are implicitly derived when not explicitly specified. This means that you cannot rely on the returned values from the getters to deduce whether a period has an explicit end date or duration.
Field Summary |
---|
Fields inherited from class net.fortuna.ical4j.model.DateRange |
---|
INCLUSIVE_END, INCLUSIVE_START |
Constructor Summary | |
---|---|
Period(DateTime start,
DateTime end)
Constructs a new period with the specied start and end date. |
|
Period(DateTime start,
Dur duration)
Constructs a new period with the specified start date and duration. |
|
Period(String aValue)
Constructor. |
Method Summary | |
---|---|
Period |
add(Period period)
Creates a period that encompasses both this period and another one. |
int |
compareTo(Object arg0)
|
int |
compareTo(Period arg0)
Compares the specified period with this period. |
boolean |
equals(Object o)
|
Dur |
getDuration()
Returns the duration of this period. |
DateTime |
getEnd()
Returns the end date of this period. |
DateTime |
getStart()
|
int |
hashCode()
|
boolean |
includes(Date date,
boolean inclusive)
Deprecated. use DateRange.includes(Date, int) instead. |
boolean |
isEmpty()
An empty period is one that consumes no time. |
void |
setTimeZone(TimeZone timezone)
Updates the start and (possible) end times of this period to reflect the specified timezone status. |
void |
setUtc(boolean utc)
Updates the start and (possible) end times of this period to reflect the specified UTC timezone status. |
PeriodList |
subtract(Period period)
Creates a set of periods resulting from the subtraction of the specified period from this one. |
String |
toString()
|
Methods inherited from class net.fortuna.ical4j.model.DateRange |
---|
adjacent, after, before, contains, getRangeEnd, getRangeStart, includes, includes, intersects |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Period(String aValue) throws ParseException
aValue
- a string representation of a period
ParseException
- where the specified string is not a valid representationpublic Period(DateTime start, DateTime end)
start
- the start date of the periodend
- the end date of the periodpublic Period(DateTime start, Dur duration)
start
- the start date of the periodduration
- the duration of the periodMethod Detail |
---|
public final Dur getDuration()
public final DateTime getEnd()
public final DateTime getStart()
public final boolean includes(Date date, boolean inclusive)
DateRange.includes(Date, int)
instead.
date
- a date to test for inclusioninclusive
- indicates if the start and end of the period are included in the test
public final Period add(Period period)
period
- the period to add to this one
public final PeriodList subtract(Period period)
period
- a period to subtract from this one
public final boolean isEmpty()
public void setUtc(boolean utc)
utc
- indicates whether the period is in UTC timepublic final void setTimeZone(TimeZone timezone)
timezone
- a timezone for the periodpublic final String toString()
toString
in class Object
public final int compareTo(Object arg0)
compareTo
in interface Comparable
public final int compareTo(Period arg0)
arg0
- a period to compare with this one
public final boolean equals(Object o)
equals
in class Object
public final int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |