|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--net.agmodel.physical.Period
|
+--net.agmodel.physical.Interval
|
+--net.agmodel.physical.MutableInterval
A mutable version of Interval. Use where the overhead of repeatedly constructing new Intervals is unacceptable eg in tight loops.
| Constructor Summary | |
MutableInterval()
Creates a MutableInterval with start and end set to the beginning and end of time respecitively; |
|
MutableInterval(Date start,
Date end)
Creates a MutableInterval from a starting and ending time. |
|
MutableInterval(Date start,
Duration duration)
Creates a MutableInterval from a starting time and duration. |
|
MutableInterval(Duration duration,
Date end)
Creates a MutableInterval from a duration and ending time. |
|
| Method Summary | |
void |
set(Date aStart,
Date anEnd)
Sets the start and end date, ensuring that start is before end |
void |
set(Date start,
Duration duration)
Sets interval from an end date and duration |
void |
set(Duration duration,
Date end)
Sets interval from an end date and duration |
void |
setEnd(Date anEnd)
Changes the end date. |
void |
setStart(Date aStart)
Changes the Period start date. |
| Methods inherited from class net.agmodel.physical.Interval |
clone, containsTimeQuantities, getDuration, getDuration, overlap |
| Methods inherited from class net.agmodel.physical.Period |
coincidesWith, coincidesWith, coincidesWith, compareTo, encompasses, getBeginningOfTime, getEarlierOf, getEnd, getEndOfTime, getLaterOf, getStart, hasBeginning, hasEnd, toString, unionWith |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public MutableInterval()
public MutableInterval(Date start,
Date end)
IllegalArgumentException - if start or end are null.
public MutableInterval(Duration duration,
Date end)
duration - the duration of the intervalend - the ending time of the interval
IllegalArgumentException - if end is null
public MutableInterval(Date start,
Duration duration)
start - the starting time of the intervalduration - the duration of the interval
IllegalArgumentException - if start is null| Method Detail |
public void setStart(Date aStart)
setStart in class PeriodaStart - the new start date for the Period (cloned), which must be before the current ending date.set(Date,Date)public void setEnd(Date anEnd)
setEnd in class PeriodanEnd - the new end date for the Period (cloned), which must be after the current starting date,set(Date,Date)
public void set(Date aStart,
Date anEnd)
set in class PeriodaStart - the new start date for the Period (cloned)anEnd - the new end date for the Period (cloned)
public void set(Duration duration,
Date end)
set in class Periodduration - the new duration for the Period (cloned)end - the new end date for the Period (cloned)
public void set(Date start,
Duration duration)
set in class Periodstart - the new start date for the Period (cloned)duration - the new duration for the Period (cloned)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||