Side of Software
Dated Collections Library 2.0

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

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

public interface ListIterator<E,D>
extends Iterator<E,D>

A forward and reverse mechanism to step through and (possibly) alter a dated list.

Since:
1.0
See Also:
Iterator, DatedList

Method Summary
 void add(E value, D from, D to)
          Inserts the specified element into the underlying list for the specified date range (optional operation).
 boolean hasPrevious()
          Indicates if the iteration has a previous element.
 int nextIndex()
          Returns the index of the next element to be returned by next.
 E previous()
          Returns the previous element in the iteration.
 int previousIndex()
          Returns the index of the next element to be returned by previous.
 void set(E value, D from, D to)
          Replaces the element last returned by a call to next or previous with the specified element for the specified date range (optional operation).
 
Methods inherited from interface sos.dated.util.Iterator
hasNext, next, remove
 

Method Detail

add

void add(E value,
         D from,
         D to)
Inserts the specified element into the underlying list for the specified date range (optional operation).

Parameters:
value - element to add to list
from - start of date range (inclusive) to add the element
to - end of date range (exclusive) to add the element
Throws:
java.lang.NullPointerException - if from or to is null
java.lang.IllegalArgumentException - if from does not precede to

hasPrevious

boolean hasPrevious()
Indicates if the iteration has a previous element.

Returns:
true if this iterator will not throw an NoSuchElementException in its next call to previous

nextIndex

int nextIndex()
Returns the index of the next element to be returned by next.

Returns:
the index of the next element to be returned by next.

previous

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

Returns:
the previous element in the iteration.
Throws:
ConcurrentModificationException - if the underlying list has unexpectly changed at the date of iteration

previousIndex

int previousIndex()
Returns the index of the next element to be returned by previous.

Returns:
the index of the next element to be returned by previous.

set

void set(E value,
         D from,
         D to)
Replaces the element last returned by a call to next or previous with the specified element for the specified date range (optional operation).

Parameters:
value - element to substitute for the element last returned by next or previous
from - start of date range (inclusive) to replace the element
to - end of date range (exclusive) to replace the element
Throws:
java.lang.UnsupportedOperationException - if this iterator does not support this operation
java.lang.NullPointerException - if from or to is null
java.lang.IllegalArgumentException - if from does not precede to
java.lang.IllegalStateException - if neither next nor previous has not been called or if remove or add has already been called since the last call to next or previous
java.lang.UnsupportedOperationException - if this iterator does not support the replacement of this element

Side of Software
Dated Collections Library 2.0

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