it.amattioli.encapsulate.dates
Class DayIterator

Show UML class diagram
java.lang.Object
  extended by it.amattioli.encapsulate.dates.DayIterator
All Implemented Interfaces:
Iterator<Day>

public class DayIterator
extends Object
implements Iterator<Day>

Iterates over a day range. A day iterator is built given a start and end day and allows to iterate over each day in the range.


Constructor Summary
DayIterator(Day start, Day end)
          Construct an iterator given the initial and end day.
 
Method Summary
 boolean hasNext()
           
 Day 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(Day start,
                   Day end)
Construct an iterator given the initial and end day.

Parameters:
start - the start day. This will be the first day the next() method will return
end - the end day. Once the next() method returned this day the hasNext() method will return false
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<Day>

next

public Day next()
Specified by:
next in interface Iterator<Day>

remove

public void remove()
Specified by:
remove in interface Iterator<Day>


Copyright © 2011. All Rights Reserved.