Package org.orekit.utils
Class SortedListTrimmer
java.lang.Object
org.orekit.utils.SortedListTrimmer
A trimmer for externally stored chronologically sorted lists.
- Since:
- 12.1
- Author:
- Evan Ward
-
Constructor Summary
ConstructorsConstructorDescriptionSortedListTrimmer(int neighborsSize) Create a new trimmer with the given neighbors size. -
Method Summary
Modifier and TypeMethodDescriptionintGet size of the list returned fromgetNeighborsSubList(AbsoluteDate, List).<T extends TimeStamped>
List<T> getNeighborsSubList(AbsoluteDate central, List<T> data) Get the entries surrounding a central date.
-
Constructor Details
-
SortedListTrimmer
public SortedListTrimmer(int neighborsSize) Create a new trimmer with the given neighbors size.- Parameters:
neighborsSize- size of the list returned fromgetNeighborsSubList(AbsoluteDate, List)
-
-
Method Details
-
getNeighborsSize
public int getNeighborsSize()Get size of the list returned fromgetNeighborsSubList(AbsoluteDate, List).- Returns:
- size of the list returned from
getNeighborsSubList(AbsoluteDate, List)
-
getNeighborsSubList
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.
- Type Parameters:
T- the type of data- Parameters:
central- central datedata- complete list of entries (must be chronologically sorted)- Returns:
- entries surrounding the specified date (sublist of
data)
-