Side of Software
Dated Collections Library 2.0

sos.dated.util
Interface Iterator<E,D>

Type Parameters:
E - the type of elements being iterated over
D - the type of dates for which this iterator applies
All Known Subinterfaces:
ListIterator<E,D>

public interface Iterator<E,D>

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

Since:
1.0
See Also:
DatedCollection, ListIterator

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

Method Detail

hasNext

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

Returns:
true if next will not throw a NoSuchElementException

next

E next()
Returns the next element in the iteration.

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

remove

void remove(D from,
            D 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. If the specified date range falls outside the range containing the date of iteration, then a DateOutOfRangeException may be thrown.

Parameters:
from - start of date range (inclusive) to remove the element
to - end of date range (exclusive) to remove the element
Throws:
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
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.NullPointerException - if from or to is null
java.lang.UnsupportedOperationException - if this iterator does not support the removal of elements

Side of Software
Dated Collections Library 2.0

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