|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.fortuna.ical4j.model.Period
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.
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. |
boolean |
adjacent(Period period)
Decides whether these periods are serial without a gap. |
boolean |
after(Period period)
Decides whether this period starts after the given period ends. |
boolean |
before(Period period)
Decides whether this period is completed before the given period starts. |
int |
compareTo(Object arg0)
|
int |
compareTo(Period arg0)
Compares the specified period with this period. |
boolean |
contains(Period period)
Decides whether the given period is completely contained within this one. |
boolean |
equals(Object o)
Overrides the equality test, compares fields of instances for equality. |
Dur |
getDuration()
Returns the duration of this period. |
DateTime |
getEnd()
Returns the end date of this period. |
DateTime |
getStart()
|
int |
hashCode()
Override hashCode() with code that checks fields in this object. |
boolean |
includes(Date date)
Decides whether a date falls within this period. |
boolean |
intersects(Period period)
Decides whether this period intersects with another one. |
String |
toString()
|
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)
date
- the date to be tested
public final boolean before(Period period)
period
- a period that may or may not start after this period ends
public final boolean after(Period period)
period
- a period that may or may not end before this period starts
public final boolean intersects(Period period)
period
- a possible intersecting period
public final boolean adjacent(Period period)
public final boolean contains(Period period)
period
- the period that may be contained by this one
public final Period add(Period period)
period
- the period to add to this one
public final String toString()
Object.toString()
public final int compareTo(Object arg0)
compareTo
in interface Comparable
public final int compareTo(Period arg0)
arg0
-
public final boolean equals(Object o)
o
- object being compared for equality
public final int hashCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |