|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.agmodel.pPhysical.PPeriod
Implements a persistent version of Period.
| Constructor Summary | |
PPeriod()
Constructs a Period with no beginning and no end. |
|
PPeriod(Date aDate,
boolean endless)
Constructs a Period from a date and an indicator as whether endless. If endless is true, construct an period starting from aDate but not ending. If endless is false, construct a period with no beginning ending at aDate. |
|
PPeriod(Date aStart,
Date anEnd)
Constructs a Period from a starting and an ending Date (both non-null with ending date after starting date) After some experimentation I've let startdate==enddate - it is more useful. |
|
PPeriod(Date aStart,
Duration duration)
Constructs a Period from an starting Date and a duration |
|
PPeriod(Duration duration,
Date anEnd)
Constructs a Period from a duration and an ending Date |
|
PPeriod(Period period)
|
|
| Method Summary | |
boolean |
coincidesWith(Date input)
Indicates whether the input date falls within the interval This method is consistent with coincides(Period) which uses an exclusive definition; See coincidesWith(Date boolean, boolean) for a more flexible version |
boolean |
coincidesWith(Date input,
boolean includeStart,
boolean includeEnd)
Indicates whether the input date falls within the interval See coincidesWith(Date) for a simpler version |
boolean |
coincidesWith(Period another)
Indicates whether this period overlaps in time with another. Returns true if this period |
int |
compareTo(Object a)
Compares two periods based on start time, and then end time if the start times are equal |
static Date |
getBeginningOfTime()
A Date which will suffice in most situations as the beginning of time This implementation may change to an earlier date at a later date. |
Date |
getEnd()
|
static Date |
getEndOfTime()
A Date corresponding to the end of time |
Period |
getPeriod()
|
Date |
getStart()
|
boolean |
hasBeginning()
Indicates whether the Period begins |
boolean |
hasEnd()
Indicates whether the Period ends |
String |
toString()
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public PPeriod(Date aStart,
Date anEnd)
IllegalArgumentException - if aStart is after aEnd
public PPeriod(Duration duration,
Date anEnd)
duration - the duration of the periodanEnd - the ending date of the period
public PPeriod(Date aStart,
Duration duration)
aStart - the starting date of the periodduration - the duration of the period
public PPeriod(Date aDate,
boolean endless)
aDate - the starting or ending date of a one-ended intervalendless - how to interpret aDatepublic PPeriod()
public PPeriod(Period period)
| Method Detail |
public boolean coincidesWith(Period another)
|-----|overlaps in time with another
|=======|passed as the parameter.
|---| |======|or
|----| |=====|both return true.
|-----|
|======|
returns false, and
|-----|
|======|
returns false.
another - period to compare with this one
public boolean coincidesWith(Date input)
coincidesWith(Date boolean, boolean) for a more flexible version
input - the Date in question
public boolean coincidesWith(Date input,
boolean includeStart,
boolean includeEnd)
coincidesWith(Date) for a simpler version
input - the Date in questionincludeStart - if input=Interval.start then also return trueincludeEnd - if input=Interval.end then also return true
public boolean hasBeginning()
public boolean hasEnd()
public Date getStart()
hasBeginning for a nice way to handle periods with no end.public Date getEnd()
hasEnd for a nice way to handle periods with no end.public String toString()
public int compareTo(Object a)
compareTo in interface Comparablea - Object to compare - assumed to be a Period
public Period getPeriod()
public static Date getBeginningOfTime()
public static Date getEndOfTime()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||