Class PythonTimeStampedCache<T extends TimeStamped>
- java.lang.Object
-
- org.orekit.utils.PythonTimeStampedCache<T>
-
- All Implemented Interfaces:
TimeStampedCache<T>
public class PythonTimeStampedCache<T extends TimeStamped> extends Object implements TimeStampedCache<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected long
pythonObject
Part of JCC Python interface to object
-
Constructor Summary
Constructors Constructor Description PythonTimeStampedCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finalize()
T
getEarliest()
Get the earliest entry in this cache.T
getLatest()
Get the latest entry in this cache.int
getMaxNeighborsSize()
Get the maximum size of the lists returned byTimeStampedCache.getNeighbors(AbsoluteDate, int)
.Stream<T>
getNeighbors(AbsoluteDate central)
Get the entries surrounding a central date.Stream<T>
getNeighbors(AbsoluteDate central, int n)
Get the entries surrounding a central date.void
pythonDecRef()
long
pythonExtension()
void
pythonExtension(long pythonObject)
-
-
-
Method Detail
-
pythonExtension
public void pythonExtension(long pythonObject)
-
pythonExtension
public long pythonExtension()
-
finalize
public void finalize() throws Throwable
-
pythonDecRef
public void pythonDecRef()
-
getNeighbors
public Stream<T> getNeighbors(AbsoluteDate central)
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.
- Specified by:
getNeighbors
in interfaceTimeStampedCache<T extends TimeStamped>
- Parameters:
central
- central date- Returns:
- list of cached entries surrounding the specified date. The size
of the list is guaranteed to be
TimeStampedCache.getMaxNeighborsSize()
. - See Also:
TimeStampedCache.getNeighbors(AbsoluteDate, int)
-
getNeighbors
public Stream<T> getNeighbors(AbsoluteDate central, int n)
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.
- Specified by:
getNeighbors
in interfaceTimeStampedCache<T extends TimeStamped>
- Parameters:
central
- central daten
- number of neighbors (cannot exceedTimeStampedCache.getMaxNeighborsSize()
)- Returns:
- stream of cached entries surrounding the specified date.
-
getMaxNeighborsSize
public int getMaxNeighborsSize()
Get the maximum size of the lists returned byTimeStampedCache.getNeighbors(AbsoluteDate, int)
.- Specified by:
getMaxNeighborsSize
in interfaceTimeStampedCache<T extends TimeStamped>
- Returns:
- size of the list
-
getEarliest
public T getEarliest() throws IllegalStateException
Get the earliest entry in this cache.- Specified by:
getEarliest
in interfaceTimeStampedCache<T extends TimeStamped>
- Returns:
- earliest cached entry
- Throws:
IllegalStateException
- if this cache is empty
-
getLatest
public T getLatest() throws IllegalStateException
Get the latest entry in this cache.- Specified by:
getLatest
in interfaceTimeStampedCache<T extends TimeStamped>
- Returns:
- latest cached entry
- Throws:
IllegalStateException
- if this cache is empty
-
-