sos.dated.util
Interface Iterator

All Known Subinterfaces:
ListIterator

public interface Iterator

A mechanism to step through and (possibly) alter a dated collection.

Since:
1.0
See Also:
DatedCollection, ListIterator

Method Summary
 boolean hasNext()
          Indicates if this iterator has another element to report.
 java.lang.Object next()
          Returns the next element in the iteration.
 void remove(java.util.Date from, java.util.Date to)
          Removes the element last returned by next from the underlying collection for the specified date range (optional operation).
 

Method Detail

hasNext

public boolean hasNext()
Indicates if this iterator has another element to report.

Returns:
true if next will not throw a NoSuchElementException

next

public java.lang.Object next()
Returns the next element in the iteration.

Returns:
the next element in the iteration
Throws:
java.util.NoSuchElementException - if the iteration has no more elements
java.util.ConcurrentModificationException - if the underlying collection has unexpectly changed at the date of iteration

remove

public void remove(java.util.Date from,
                   java.util.Date to)
Removes the element last returned by next from the underlying collection for the specified date range (optional operation). Even if this iterator supports this operation, it may not support it for all possible date ranges. However, it may not to throw a DateOutOfRangeException if the specified date range falls within the current window that contains the date of iteration and that contains no change of state of the underlying collection.

Parameters:
from - start of date range (inclusive) to remove the element
to - end of date range (exclusive) to remove the element
Throws:
java.lang.NullPointerException - if from or to is null
java.lang.IllegalArgumentException - if from does not precede to
java.lang.IllegalStateException - if next has not been called or if remove has already been called since the last call to next
java.lang.UnsupportedOperationException - if this iterator does not support the removal of elements
DateOutOfRangeException - if the date for which this iteration is occuring is not included in the specified date range or if the specified date range spans multiple states of the underlying collection and this iterator does not handle such a large range


Copyright 2003 Side of Software (SOS). All rights reserved.