|
||||||||||
| 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: Period.java,v 1.31 2011/02/20 03:12:32 fortuna Exp $ [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(java.lang.String aValue)
Constructor. |
|
| Method Summary | |
|---|---|
Period |
add(Period period)
Creates a period that encompasses both this period and another one. |
int |
compareTo(java.lang.Object arg0)
|
int |
compareTo(Period arg0)
Compares the specified period with this period. |
boolean |
equals(java.lang.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(java.util.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. |
java.lang.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(java.lang.String aValue)
throws java.text.ParseException
aValue - a string representation of a period
java.text.ParseException - where the specified string is not a valid representation
public Period(DateTime start,
DateTime end)
start - the start date of the periodend - the end date of the period
public Period(DateTime start,
Dur duration)
start - the start date of the periodduration - the duration of the period| Method Detail |
|---|
public final Dur getDuration()
public final DateTime getEnd()
public final DateTime getStart()
public final boolean includes(java.util.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 java.lang.String toString()
toString in class java.lang.Objectpublic final int compareTo(java.lang.Object arg0)
compareTo in interface java.lang.Comparablepublic final int compareTo(Period arg0)
arg0 - a period to compare with this one
public final boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic final int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||