Package org.orekit.utils
Class SortedListTrimmer
- java.lang.Object
-
- org.orekit.utils.SortedListTrimmer
-
public class SortedListTrimmer extends Object
A trimmer for externally stored chronologically sorted lists.- Since:
- 12.1
- Author:
- Evan Ward
-
-
Constructor Summary
Constructors Constructor Description SortedListTrimmer(int neighborsSize)
Create a new trimmer with the given neighbors size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getNeighborsSize()
Get 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 Detail
-
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 Detail
-
getNeighborsSize
public int getNeighborsSize()
Get size of the list returned fromgetNeighborsSubList(AbsoluteDate, List)
.- Returns:
- size of the list returned from
getNeighborsSubList(AbsoluteDate, List)
-
getNeighborsSubList
public <T extends TimeStamped> List<T> getNeighborsSubList(AbsoluteDate central, List<T> data)
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
)
-
-