|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--sos.dated.util.Adapters
A bridge between dated and non-dated collections.
This class provides two ways to disguise a dated collection as a non-dated
collection. The first returns a snapshot at the collection at a given date.
Since the returned non-dated collections reflect an instant in time, they are
unmodifiable. For this approach, use the following methods. Note that there
is no need for a DatedValue view because all dated values
provide a get method.
asCollection(DatedCollection,Date)
asList(DatedList,Date)
asSet(DatedSet,Date)
asSortedSet(DatedSortedSet,Date)
asSortedMap(DatedSortedMap,Date)
asMap(DatedMap,Date)
asCollection(DatedCollection,Date,Date)
asList(DatedList,Date,Date)
asSet(DatedSet,Date,Date)
asSortedSet(DatedSortedSet,Date,Date)
asSortedMap(DatedSortedMap,Date,Date)
asMap(DatedMap,Date,Date)
asDatedCollection(Collection,Date,Date)
asDatedList(List,Date,Date)
asDatedSet(Set,Date,Date)
asDatedSortedSet(SortedSet,Date,Date)
asDatedSortedMap(SortedMap,Date,Date)
asDatedMap(Map,Date,Date)
DatedCollection,
DatedSet,
DatedList,
DatedMap,
DatedCollections| Method Summary | |
static java.util.Collection |
asCollection(DatedCollection datedCollection,
java.util.Date date)
Returns an unmodifiable non-dated version of the specified dated collection at the specified date. |
static java.util.Collection |
asCollection(DatedCollection datedCollection,
java.util.Date from,
java.util.Date to)
Returns a modifiable non-dated version of the specified dated collection for the specified date range. |
static DatedCollection |
asDatedCollection(java.util.Collection collection,
java.util.Date from,
java.util.Date to)
Treats a non-dated collection as a dated collection between the specified dates. |
static DatedList |
asDatedList(java.util.List list,
java.util.Date from,
java.util.Date to)
Returns an unmodifiable dated view of a list. |
static DatedMap |
asDatedMap(java.util.Map map,
java.util.Date from,
java.util.Date to)
Turns a map into a dated sorted map. |
static DatedSet |
asDatedSet(java.util.Set set,
java.util.Date from,
java.util.Date to)
Turns a set into a dated set. |
static DatedSortedMap |
asDatedSortedMap(java.util.SortedMap map,
java.util.Date from,
java.util.Date to)
Turns a sorted map into a dated sorted map. |
static DatedSortedSet |
asDatedSortedSet(java.util.SortedSet set,
java.util.Date from,
java.util.Date to)
Turns a sorted set into a dated sorted set. |
static DatedValue |
asDatedValue(java.lang.Object value,
java.util.Date from,
java.util.Date to)
Turns a value into a dated value. |
static java.util.List |
asList(DatedList datedList,
java.util.Date date)
Returns an unmodifiable non-dated version of the specified dated list at the specified date. |
static java.util.List |
asList(DatedList datedList,
java.util.Date from,
java.util.Date to)
Returns a modifiable non-dated version of the specified dated list for the specified date range. |
static java.util.Map |
asMap(DatedMap datedMap,
java.util.Date date)
Returns an unmodifiable non-dated version of the specified dated map at the specified date. |
static java.util.Map |
asMap(DatedMap datedMap,
java.util.Date from,
java.util.Date to)
Returns a modifiable non-dated version of the specified dated map for the specified date range. |
static java.util.Set |
asSet(DatedSet datedSet,
java.util.Date date)
Returns an unmodifiable non-dated version of the specified dated set at the specified date. |
static java.util.Set |
asSet(DatedSet datedSet,
java.util.Date from,
java.util.Date to)
Returns a modifiable non-dated version of the specified dated set for the specified date range. |
static java.util.SortedMap |
asSortedMap(DatedSortedMap datedMap,
java.util.Date date)
Returns an unmodifiable non-dated version of the specified dated sorted map at the specified date. |
static java.util.SortedMap |
asSortedMap(DatedSortedMap datedSortedMap,
java.util.Date from,
java.util.Date to)
Returns a modifiable non-dated version of the specified dated sorted map for the specified date range. |
static java.util.SortedSet |
asSortedSet(DatedSortedSet datedSet,
java.util.Date date)
Returns an unmodifiable non-dated version of the specified dated sorted set at the specified date. |
static java.util.SortedSet |
asSortedSet(DatedSortedSet datedSortedSet,
java.util.Date from,
java.util.Date to)
Returns a modifiable non-dated version of the specified dated sorted set for the specified date range. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static java.util.Collection asCollection(DatedCollection datedCollection,
java.util.Date date)
datedCollection - dated collection to treat as non-dateddate - date slice of datedCollection to treat as a Collection
java.lang.NullPointerException - if any argument is null
public static java.util.List asList(DatedList datedList,
java.util.Date date)
datedList - dated list to treat as non-dateddate - date slice of datedList to treat as a List
java.lang.NullPointerException - if any argument is null
public static java.util.Set asSet(DatedSet datedSet,
java.util.Date date)
datedSet - dated set to treat as non-dateddate - date slice of datedSet to treat as a Set
java.lang.NullPointerException - if any argument is null
public static java.util.SortedMap asSortedMap(DatedSortedMap datedMap,
java.util.Date date)
date - date slice of datedSortedMap to treat as a SortedMap
java.lang.NullPointerException - if any argument is null
public static java.util.SortedSet asSortedSet(DatedSortedSet datedSet,
java.util.Date date)
datedSet - dated sorted set to treat as non-dateddate - date slice of datedSortedSet to treat as a SortedSet
java.lang.NullPointerException - if any argument is null
public static java.util.Map asMap(DatedMap datedMap,
java.util.Date date)
date - date slice of datedMap to treat as a Map
java.lang.NullPointerException - if any argument is null
public static java.util.Collection asCollection(DatedCollection datedCollection,
java.util.Date from,
java.util.Date to)
datedCollection - dated collection to treat as non-datedfrom - start date (inclusive) of static range of datedCollection
to treat as non-datedto - end date (exclusive) of static range of datedCollection
to treat as non-dated
java.lang.NullPointerException - if any argument is null
java.lang.IllegalArgumentException - if from does not precede to
DateOutOfRangeException - if datedCollection changes between from and to
public static java.util.List asList(DatedList datedList,
java.util.Date from,
java.util.Date to)
datedList - dated list to treat as non-datedfrom - start date (inclusive) of static range of datedList
to treat as non-datedto - end date (exclusive) of static range of datedList
to treat as non-dated
java.lang.NullPointerException - if any argument is null
java.lang.IllegalArgumentException - if from does not precede to
DateOutOfRangeException - if datedList changes between from and to
public static java.util.Map asMap(DatedMap datedMap,
java.util.Date from,
java.util.Date to)
datedMap - dated map to treat as non-datedfrom - start date (inclusive) of static range of datedMap
to treat as non-datedto - end date (exclusive) of static range of datedMap
to treat as non-dated
java.lang.NullPointerException - if any argument is null
java.lang.IllegalArgumentException - if from does not precede to
DateOutOfRangeException - if datedMap changes between from and to
public static java.util.Set asSet(DatedSet datedSet,
java.util.Date from,
java.util.Date to)
datedSet - dated set to treat as non-datedfrom - start date (inclusive) of static range of datedSet
to treat as non-datedto - end date (exclusive) of static range of datedSet
to treat as non-dated
java.lang.NullPointerException - if any argument is null
java.lang.IllegalArgumentException - if from does not precede to
DateOutOfRangeException - if datedSet changes between from and to
public static java.util.SortedMap asSortedMap(DatedSortedMap datedSortedMap,
java.util.Date from,
java.util.Date to)
datedSortedMap - dated sorted map to treat as non-datedfrom - start date (inclusive) of static range of datedSortedMap
to treat as non-datedto - end date (exclusive) of static range of datedSortedMap
to treat as non-dated
java.lang.NullPointerException - if any argument is null
java.lang.IllegalArgumentException - if from does not precede to
DateOutOfRangeException - if datedSortedMap changes between from and to
public static java.util.SortedSet asSortedSet(DatedSortedSet datedSortedSet,
java.util.Date from,
java.util.Date to)
datedSortedSet - dated sorted set to treat as non-datedfrom - start date (inclusive) of static range of datedSortedSet
to treat as non-datedto - end date (exclusive) of static range of datedSortedSet
to treat as non-dated
java.lang.NullPointerException - if any argument is null
java.lang.IllegalArgumentException - if from does not precede to
DateOutOfRangeException - if datedSortedSet changes between from and to
public static DatedCollection asDatedCollection(java.util.Collection collection,
java.util.Date from,
java.util.Date to)
collection - collection to treat as datedfrom - start date (inclusive) of range for which the returned dated collection
should contain the elements of collectionto - end date (exclusive) of range for which the returned dated collection
should contain the elements of collection
java.lang.NullPointerException - if any argument is null
java.lang.IllegalArgumentException - if from does not precede to
public static DatedList asDatedList(java.util.List list,
java.util.Date from,
java.util.Date to)
list - list to be viewed as datedfrom - starting date (inclusive)to - ending date (exclusive)
public static DatedMap asDatedMap(java.util.Map map,
java.util.Date from,
java.util.Date to)
map - map to be treated as datedfrom - start of date range (inclusive) for which the returned dated
map has the entries of the specified mapto - end of date range (exclusive) for which the returned dated
map has the entries of the specified map
public static DatedSet asDatedSet(java.util.Set set,
java.util.Date from,
java.util.Date to)
set - set to be treated as datedfrom - start of date range (inclusive) for which the returned dated
set has the elements of the specified setto - end of date range (exclusive) for which the returned dated
set has the elements of the specified set
public static DatedSortedMap asDatedSortedMap(java.util.SortedMap map,
java.util.Date from,
java.util.Date to)
map - sorted map to be treated as datedfrom - start of date range (inclusive) for which the returned dated
map has the entries of the specified mapto - end of date range (exclusive) for which the returned dated
map has the entries of the specified map
public static DatedSortedSet asDatedSortedSet(java.util.SortedSet set,
java.util.Date from,
java.util.Date to)
set - sorted set to be treated as datedfrom - start of date range (inclusive) for which the returned dated
set has the elements of the specified setto - end of date range (exclusive) for which the returned dated
set has the elements of the specified set
public static DatedValue asDatedValue(java.lang.Object value,
java.util.Date from,
java.util.Date to)
value - value to be treated as datedfrom - start of date range (inclusive) for which the returned dated
value has the specified valueto - end of date range (exclusive) for which the returned dated
value has the specified value
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||