sos.dated.util
Class AbstractSequentialDatedList

java.lang.Object
  |
  +--sos.dated.util.AbstractDatedObject
        |
        +--sos.dated.util.AbstractDatedCollection
              |
              +--sos.dated.util.AbstractDatedList
                    |
                    +--sos.dated.util.AbstractSequentialDatedList
All Implemented Interfaces:
DatedCollection, DatedList, DatedObject

public abstract class AbstractSequentialDatedList
extends AbstractDatedList

A partial implementation of a dated list that does not provide random access to its elements at a given date. The purpose of this class is to make it easier to implement a sequential dated list. All of the methods implemented in this class operate on the list iterator, which is defined by a subclass.

To create an unmodifiable list, the programmer can subclass this class and implement listIterator(int). The list iterator returned by this method need only define the query methods: hasNext, hasPrevious, next, nextIndex, previous, and previousIndex. The remaining methods should throw UnsupportedOperationExceptions.

To create a modifiable list, the programmer must implement the above methods that throw UnsupportedOperationExceptions.

Upon subclassing this class, the programmer may wish to override those methods that can be implemented more efficiently with knowledge of the underlying data structure.

This class is not Serializable or Cloneable. Subclasses are free to decide if they wish to implement these interfaces.

Since:
1.0
See Also:
AbstractDatedList, DatedList

Field Summary
 
Fields inherited from interface sos.dated.util.DatedObject
MAX_DATE, MIN_DATE
 
Constructor Summary
AbstractSequentialDatedList()
          No-argument constructor available only to subclasses.
 
Method Summary
 void add(int index, java.lang.Object value, java.util.Date from, java.util.Date to)
          This implementation invokes the list iterator's add method for each list iterator at a change date between from and to.
 java.lang.Object get(int index, java.util.Date date)
          This implementation uses the list iterator at date and positioned at index to retrieve the element.
abstract  ListIterator listIterator(int index, java.util.Date date)
          Returns a list iterator over the elements of this dated list at the specified date, starting at the specified index.
 DatedValue remove(int index, java.util.Date from, java.util.Date to)
          This implementation invokes remove on the list iterator at each change date between from and to.
 DatedValue set(int index, java.lang.Object value, java.util.Date from, java.util.Date to)
          This implementation invokes set on the list iterator at each change date between from and to.
 
Methods inherited from class sos.dated.util.AbstractDatedList
add, addAll, checkForComodification, clear, clone, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, modCount, removeRange, size, subList, upModCount
 
Methods inherited from class sos.dated.util.AbstractDatedCollection
addAll, contains, containsAll, containsThroughout, dateIterator, excludesThroughout, hasSizeThroughout, isEmpty, isEmptyThroughout, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class sos.dated.util.AbstractDatedObject
dateIterator, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface sos.dated.util.DatedCollection
addAll, contains, containsAll, containsThroughout, excludesThroughout, hasSizeThroughout, isEmpty, isEmptyThroughout, remove, removeAll, retainAll, toArray, toArray
 
Methods inherited from interface sos.dated.util.DatedObject
dateIterator, dateIterator, equals, hashCode, toString
 

Constructor Detail

AbstractSequentialDatedList

public AbstractSequentialDatedList()
No-argument constructor available only to subclasses.

Method Detail

add

public void add(int index,
                java.lang.Object value,
                java.util.Date from,
                java.util.Date to)
This implementation invokes the list iterator's add method for each list iterator at a change date between from and to.

Specified by:
add in interface DatedList
Overrides:
add in class AbstractDatedList

get

public java.lang.Object get(int index,
                            java.util.Date date)
This implementation uses the list iterator at date and positioned at index to retrieve the element.

Specified by:
get in interface DatedList
Specified by:
get in class AbstractDatedList
Parameters:
index - position to retrieve an element
date - date at which this list is to be queried
Returns:
the element at the specified position on the specified date

listIterator

public abstract ListIterator listIterator(int index,
                                          java.util.Date date)
Description copied from class: AbstractDatedList
Returns a list iterator over the elements of this dated list at the specified date, starting at the specified index. This implementation creates a fully functional list iterator, positioned at the element given by index and date. The list iterator's update operations call this dated list's add(int,Object,Date,Date), remove(int,Date,Date), and set(int,Object,Date,Date).

Specified by:
listIterator in interface DatedList
Overrides:
listIterator in class AbstractDatedList

remove

public DatedValue remove(int index,
                         java.util.Date from,
                         java.util.Date to)
This implementation invokes remove on the list iterator at each change date between from and to.

Specified by:
remove in interface DatedList
Overrides:
remove in class AbstractDatedList

set

public DatedValue set(int index,
                      java.lang.Object value,
                      java.util.Date from,
                      java.util.Date to)
This implementation invokes set on the list iterator at each change date between from and to.

Specified by:
set in interface DatedList
Overrides:
set in class AbstractDatedList


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