|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jaret.util.date.iterator.AbstractDateIterator
public abstract class AbstractDateIterator
Abstract base Implementation of a DateIterator.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface de.jaret.util.date.iterator.DateIterator |
|---|
DateIterator.Format |
| Field Summary | |
|---|---|
protected boolean |
_correctDST
true if DST should be corrected. |
protected JaretDate |
_currentDate
the current date. |
protected JaretDate |
_endDate
the last date. |
protected IIteratorFormatter |
_formatter
if set this formatter overrides default behaviour. |
protected boolean |
_lastInDST
flag for remembering if the last date was in or out DST. |
| Constructor Summary | |
|---|---|
AbstractDateIterator()
Default constructor. |
|
AbstractDateIterator(JaretDate startDate,
JaretDate endDate)
Constructor supplying values. |
|
| Method Summary | |
|---|---|
protected abstract void |
advanceDate(JaretDate date)
Advance the given date by the amount necessary. |
protected abstract JaretDate |
correctStartDate(JaretDate date)
Correct the given date to a clean starting position. |
protected abstract IIteratorFormatter |
getDefaultFormatter()
Internal method to retrieve a default formatter. |
protected IIteratorFormatter |
getFormatter()
Retrieve the formatter to use. |
String |
getLabel(JaretDate date,
DateIterator.Format format)
Retrieve a label for a given date. |
JaretDate |
getNextDate()
Retrieve the next date from the iterator. |
boolean |
hasNextDate()
Check whether the iterator will supply a next date. |
JaretDate |
previewNextDate()
Retrieve the next date without modifying the iterator. |
void |
reInitialize(JaretDate startDate,
JaretDate endDate)
(re)initialize the iterator with a start and an end date. |
void |
setCorrectDST(boolean correctDST)
If the correct DST flag is set to true, the iterator will add/remove an hour if the DST switch time has been passed. |
void |
setFormatter(IIteratorFormatter formatter)
Set a formatter to be used with this iterator overriding the default formatting. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.jaret.util.date.iterator.DateIterator |
|---|
getApproxStepMilliSeconds |
| Field Detail |
|---|
protected JaretDate _currentDate
protected JaretDate _endDate
protected boolean _correctDST
protected boolean _lastInDST
protected IIteratorFormatter _formatter
| Constructor Detail |
|---|
public AbstractDateIterator(JaretDate startDate,
JaretDate endDate)
startDate - start dateendDate - end date. null for unlimited iteratingpublic AbstractDateIterator()
| Method Detail |
|---|
protected abstract JaretDate correctStartDate(JaretDate date)
date - start date
protected abstract void advanceDate(JaretDate date)
date - date to be modified
public void reInitialize(JaretDate startDate,
JaretDate endDate)
reInitialize in interface DateIteratorstartDate - first date that will be returned in subsequent callsendDate - last date that will be returnedpublic JaretDate getNextDate()
getNextDate in interface DateIteratorpublic boolean hasNextDate()
hasNextDate in interface DateIteratorpublic JaretDate previewNextDate()
previewNextDate in interface DateIteratornull if no subsequent date is available
public String getLabel(JaretDate date,
DateIterator.Format format)
getLabel in interface DateIteratordate - the date to formatformat - short, medium or long
protected IIteratorFormatter getFormatter()
protected abstract IIteratorFormatter getDefaultFormatter()
public void setFormatter(IIteratorFormatter formatter)
setFormatter in interface DateIteratorformatter - the formatter to use.public void setCorrectDST(boolean correctDST)
setCorrectDST in interface DateIterator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||