com.atlassian.greenhopper.util
Class DayIterator

java.lang.Object
  extended by com.atlassian.greenhopper.util.DayIterator
All Implemented Interfaces:
java.util.Iterator<org.joda.time.DateMidnight>

public class DayIterator
extends java.lang.Object
implements java.util.Iterator<org.joda.time.DateMidnight>

Iterates over the given interval on a per-day-basis, until end (inclusive) is reached. Additionally, it gives information about the number of the current day from the iteration.

Author:
ahennecke

Constructor Summary
DayIterator(org.joda.time.DateMidnight start, org.joda.time.DateMidnight end)
           
 
Method Summary
 int getDayNumber()
           
 int getDaysLeft()
           
 boolean hasNext()
           
 org.joda.time.DateMidnight next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DayIterator

public DayIterator(org.joda.time.DateMidnight start,
                   org.joda.time.DateMidnight end)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator<org.joda.time.DateMidnight>

next

public org.joda.time.DateMidnight next()
Specified by:
next in interface java.util.Iterator<org.joda.time.DateMidnight>

remove

public void remove()
Specified by:
remove in interface java.util.Iterator<org.joda.time.DateMidnight>

getDayNumber

public int getDayNumber()
Returns:
the number of the day the iterator currently is at, starting from 1 after the first call to next(). Before the first call, dayNumber is 0, indicating that the iterator is not currently on any state. At the end of the iteration, when hasNext() becomes false, dayNumber represents the number of days between start and end, inclusive.

getDaysLeft

public int getDaysLeft()


Copyright © 2007-2012 Atlassian. All Rights Reserved.