org.hackystat.utilities.time.interval
Class MonthIterator

java.lang.Object
  extended by org.hackystat.utilities.time.interval.MonthIterator
All Implemented Interfaces:
java.util.Iterator<Month>

public class MonthIterator
extends java.lang.Object
implements java.util.Iterator<Month>

Defines iterator for month interval.

Author:
Hongbing Kou

Constructor Summary
MonthIterator(MonthInterval monthInterval)
          Creates an iterator.
 
Method Summary
 boolean hasNext()
          If it is before the end month it will be a good one.
 Month next()
          Gets the next month.
 void remove()
          Required for iterator().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MonthIterator

MonthIterator(MonthInterval monthInterval)
Creates an iterator.

Parameters:
monthInterval - Month Interval.
Method Detail

next

public Month next()
Gets the next month.

Specified by:
next in interface java.util.Iterator<Month>
Returns:
Next month.

hasNext

public boolean hasNext()
If it is before the end month it will be a good one.

Specified by:
hasNext in interface java.util.Iterator<Month>
Returns:
Run our of interval or not.

remove

public void remove()
Required for iterator(). It will throw UnSupportedMethodException.

Specified by:
remove in interface java.util.Iterator<Month>