Package org.orekit.utils
Class PythonFieldTimeStampedCache<T extends FieldTimeStamped<KK>,KK extends CalculusFieldElement<KK>>
- java.lang.Object
-
- org.orekit.utils.PythonFieldTimeStampedCache<T,KK>
-
- All Implemented Interfaces:
FieldTimeStampedCache<T,KK>
public class PythonFieldTimeStampedCache<T extends FieldTimeStamped<KK>,KK extends CalculusFieldElement<KK>> extends Object implements FieldTimeStampedCache<T,KK>
-
-
Field Summary
Fields Modifier and Type Field Description protected long
pythonObject
Part of JCC Python interface to object
-
Constructor Summary
Constructors Constructor Description PythonFieldTimeStampedCache()
-
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.Stream<T>
getNeighbors(FieldAbsoluteDate<KK> central)
Get the entries surrounding a central date.int
getNeighborsSize()
Get the fixed size of the lists returned byFieldTimeStampedCache.getNeighbors(FieldAbsoluteDate)
.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(FieldAbsoluteDate<KK> 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 interfaceFieldTimeStampedCache<T extends FieldTimeStamped<KK>,KK extends CalculusFieldElement<KK>>
- Parameters:
central
- central date- Returns:
- list of cached entries surrounding the specified date. The size of the list is guaranteed to be
FieldTimeStampedCache.getNeighborsSize()
.
-
getNeighborsSize
public int getNeighborsSize()
Get the fixed size of the lists returned byFieldTimeStampedCache.getNeighbors(FieldAbsoluteDate)
.- Specified by:
getNeighborsSize
in interfaceFieldTimeStampedCache<T extends FieldTimeStamped<KK>,KK extends CalculusFieldElement<KK>>
- Returns:
- size of the list
-
getEarliest
public T getEarliest() throws IllegalStateException
Get the earliest entry in this cache.- Specified by:
getEarliest
in interfaceFieldTimeStampedCache<T extends FieldTimeStamped<KK>,KK extends CalculusFieldElement<KK>>
- Returns:
- earliest cached entry
- Throws:
IllegalStateException
- if this cache is empty
-
getLatest
public T getLatest() throws IllegalStateException
Description copied from interface:FieldTimeStampedCache
Get the latest entry in this cache.- Specified by:
getLatest
in interfaceFieldTimeStampedCache<T extends FieldTimeStamped<KK>,KK extends CalculusFieldElement<KK>>
- Returns:
- latest cached entry
- Throws:
IllegalStateException
- if this cache is empty
-
-