org.chronicj
Class RangeIterator

java.lang.Object
  |
  +--org.chronicj.RangeIterator
All Implemented Interfaces:
java.util.Iterator

public class RangeIterator
extends java.lang.Object
implements java.util.Iterator

Simple Iteratorimplmentation that can be used to traverse the sub ranges that occur between the start and end TimePointsof a given DateRange.

Iteration proceeds using the following semantics:

Author:
Matthew Lipper
See Also:
DateRange, TimePoint, Iterator, Range

Constructor Summary
RangeIterator(org.chronicj.DateRange aDateRange)
           
 
Method Summary
 boolean hasNext()
          Returns:
currentRange.includes(nextRangeIndex));
 java.lang.Object next()
          Returns:
new DateRange(currentRangeIndex.start().increment(1), currentRangeIndex.start().increment(2));
 void remove()
          Currently, throws an UnsupportedOperationException as this method is not supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeIterator

public RangeIterator(org.chronicj.DateRange aDateRange)
Method Detail

hasNext

public boolean hasNext()
Returns:
currentRange.includes(nextRangeIndex));

Specified by:
hasNext in interface java.util.Iterator
See Also:
Iterator.hasNext()

next

public java.lang.Object next()
Returns:
new DateRange(currentRangeIndex.start().increment(1), currentRangeIndex.start().increment(2));

Specified by:
next in interface java.util.Iterator
See Also:
Iterator.next()

remove

public void remove()
Currently, throws an UnsupportedOperationException as this method is not supported.

Specified by:
remove in interface java.util.Iterator
See Also:
Iterator.remove()


Copyright © 2003-2004 Digital Clash Software. All Rights Reserved.