Interface TimeStampedCache<T extends TimeStamped>
- Type Parameters:
T- the type of data
- All Known Implementing Classes:
GenericTimeStampedCache,ImmutableTimeStampedCache
TimeStamped data surrounding a given date.- Author:
- Luc Maisonobe, Evan Ward
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGet the earliest entry in this cache.Get the latest entry in this cache.intGet the maximum size of the lists returned bygetNeighbors(AbsoluteDate, int).getNeighbors(AbsoluteDate central) Get the entries surrounding a central date.getNeighbors(AbsoluteDate central, int n) Get the entries surrounding a central date.
-
Method Details
-
getNeighbors
Get the entries surrounding a central date.If the central date is well within covered range, the returned array will be balanced with half the points before central date and half the points after it (depending on n parity, of course). If the central date is near the boundary, then the returned array will be unbalanced and will contain only the n earliest (or latest) entries. A typical example of the later case is leap seconds cache, since the number of leap seconds cannot be arbitrarily increased.
This method is safe for multiple threads to execute concurrently.
- Parameters:
central- central date- Returns:
- list of cached entries surrounding the specified date. The size
of the list is guaranteed to be
getMaxNeighborsSize(). - See Also:
-
getNeighbors
Get the entries surrounding a central date.If the central date is well within covered range, the returned array will be balanced with half the points before central date and half the points after it (depending on n parity, of course). If the central date is near the boundary, then the returned array will be unbalanced and will contain only the n earliest (or latest) entries. A typical example of the later case is leap seconds cache, since the number of leap seconds cannot be arbitrarily increased.
This method is safe for multiple threads to execute concurrently.
- Parameters:
central- central daten- number of neighbors (cannot exceedgetMaxNeighborsSize())- Returns:
- stream of cached entries surrounding the specified date.
- Since:
- 12.0
-
getMaxNeighborsSize
int getMaxNeighborsSize()Get the maximum size of the lists returned bygetNeighbors(AbsoluteDate, int).- Returns:
- size of the list
-
getEarliest
Get the earliest entry in this cache.- Returns:
- earliest cached entry
- Throws:
IllegalStateException- if this cache is empty
-
getLatest
Get the latest entry in this cache.- Returns:
- latest cached entry
- Throws:
IllegalStateException- if this cache is empty
-