|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--sos.dated.util.AbstractDatedObject
|
+--sos.dated.util.AbstractDatedCollection
|
+--sos.dated.util.AbstractDatedList
|
+--sos.dated.util.AbstractListByDate
|
+--sos.dated.util.ArrayListByDate
An implementation of DatedList that can efficiently iterate through the list of
elements at a given date by maintaining a java.util.ArrayList at each date.
This implementation is serializable and cloneable; however, it is not
synchronized. To use it safely in a multi-threaded situation, wrap an
instance of the dated list with a call to DatedCollections.synchronizedDatedList.
ArrayListByElement,
DatedList,
DatedCollections.synchronizedDatedList(DatedList)| Field Summary |
| Fields inherited from interface sos.dated.util.DatedObject |
MAX_DATE, MIN_DATE |
| Constructor Summary | |
ArrayListByDate()
Creates a new instance of ArrayListByDate. |
|
ArrayListByDate(DatedCollection datedCollection)
Creates a new instance of ArrayListByDate initialized with the elements
of datedCollection. |
|
| Method Summary | |
void |
add(int index,
java.lang.Object value,
java.util.Date from,
java.util.Date to)
Inserts an element into the list for a specified date range (optional operation). |
Dates |
add(java.lang.Object value,
java.util.Date from,
java.util.Date to)
Adds an instance of the specified element to this collection for the specified date range (optional operation). |
void |
clear(java.util.Date from,
java.util.Date to)
Removes all elements from this dated collection for the specified dates (optional operation). |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
protected java.util.List |
copyList(java.util.List list)
|
protected java.util.List |
createList()
|
DateIterator |
dateIterator(java.util.Date date)
Returns an iterator of the date ranges of when this dated object has changed, starting at the range that contains the specified date. |
java.lang.Object |
get(int index,
java.util.Date date)
Retrieves the element at the specified position on the specified date. |
DatedValue |
remove(int index,
java.util.Date from,
java.util.Date to)
Removes from this list the element at the specified position for the specified date range (optional operation). |
DatedValue |
set(int index,
java.lang.Object value,
java.util.Date from,
java.util.Date to)
Replaces the element at the specified position with the specified element for the specified date range. |
int |
size(java.util.Date date)
Returns the number of elements in this collection at the specified date. |
| Methods inherited from class sos.dated.util.AbstractDatedList |
addAll, checkForComodification, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, modCount, removeRange, subList, upModCount |
| Methods inherited from class sos.dated.util.AbstractDatedCollection |
addAll, contains, containsAll, containsThroughout, 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.DatedList |
add, addAll, equals, get, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, set, subList |
| Methods inherited from interface sos.dated.util.DatedCollection |
add, addAll, clear, contains, containsAll, containsThroughout, excludesThroughout, hasSizeThroughout, isEmpty, isEmptyThroughout, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Methods inherited from interface sos.dated.util.DatedObject |
dateIterator, dateIterator, equals, hashCode, toString |
| Constructor Detail |
public ArrayListByDate()
ArrayListByDate.
public ArrayListByDate(DatedCollection datedCollection)
ArrayListByDate initialized with the elements
of datedCollection.
datedCollection - collection with which to initialize the new ArrayListByDate
java.lang.NullPointerException - if datedCollection is null| Method Detail |
public java.lang.Object clone()
AbstractDatedListclone method.
clone in class sos.dated.util.AbstractListByDateprotected java.util.List createList()
createList in class sos.dated.util.AbstractListByDateprotected java.util.List copyList(java.util.List list)
copyList in class sos.dated.util.AbstractListByDate
public Dates add(java.lang.Object value,
java.util.Date from,
java.util.Date to)
add in interface DatedCollectionadd in class AbstractDatedListvalue - element to addfrom - starting date at which the element should be addedto - ending date at which the element should be added
java.lang.NullPointerException - if from or to is null
java.lang.UnsupportedOperationException - if this collection does not support add
public void add(int index,
java.lang.Object value,
java.util.Date from,
java.util.Date to)
DatedList
add in interface DatedListadd in class AbstractDatedListindex - position to insert the elementvalue - element to insertfrom - starting date at which the element should be insertedto - ending date at which the element should be inserted
public void clear(java.util.Date from,
java.util.Date to)
DatedCollection
clear in interface DatedCollectionclear in class AbstractDatedListfrom - date to start clearing the collection, inclusiveto - date to finish clearing the collection, exclusivepublic DateIterator dateIterator(java.util.Date date)
dateIterator in interface DatedObjectdateIterator in class AbstractDatedCollectiondate - date to position the iteration
java.lang.NullPointerException - if date is null
public java.lang.Object get(int index,
java.util.Date date)
get in interface DatedListget in class AbstractDatedListindex - position to retrieve an elementdate - date at which this list is to be queried
java.lang.NullPointerException - if date is null
java.lang.IllegalArgumentException - if index < 0
public DatedValue remove(int index,
java.util.Date from,
java.util.Date to)
DatedList
remove in interface DatedListremove in class AbstractDatedListindex - position at which to start the iterationfrom - starting date at which the element should be removedto - ending date at which the element should be removed
public DatedValue set(int index,
java.lang.Object value,
java.util.Date from,
java.util.Date to)
DatedList
set in interface DatedListset in class AbstractDatedListindex - position to place the elementvalue - element to place in this listfrom - starting date at which the position should be setto - ending date at which the position should be setpublic int size(java.util.Date date)
DatedCollection
size in interface DatedCollectionsize in class AbstractDatedListdate - date at which this collection is to be queried
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||