Class ParameterDriversList
- java.lang.Object
-
- org.orekit.utils.ParameterDriversList
-
public class ParameterDriversList extends Object
Class managing severalparameter drivers
, taking care of duplicated names.Once parameter drivers sharing the same name have been added to an instance of this class, they are permanently bound together and also bound to the
delegating driver
that manages them. This means that if driversd1
,d2
...dn
are added to the list and both correspond to parameter name "P", thengetDrivers()
will return a list containing a delegating driverdelegateD
for the same name "P". Afterwards, whenever eitherParameterDriver.setValue(double)
orParameterDriver.setReferenceDate(AbsoluteDate)
is called on any of then+1
instancesd1
,d2
...dn
ordelegateD
, the call will be automatically forwarded to then
remaining instances, hence ensuring they remain consistent with each other.- Since:
- 8.0
- Author:
- Luc Maisonobe, Mélina Vanel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ParameterDriversList.DelegatingDriver
Specialized driver delegating to several other managing the same parameter name.
-
Constructor Summary
Constructors Constructor Description ParameterDriversList()
Creates an empty list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(ParameterDriver driver)
Add a driver.void
filter(boolean selected)
Filter parameters to keep only one type of selection status.ParameterDriversList.DelegatingDriver
findByName(String name)
Find adelegating driver
by name.String
findDelegatingSpanNameBySpanName(String name)
Find adelegating driver
by name.List<ParameterDriversList.DelegatingDriver>
getDrivers()
Get delegating drivers for all parameters.int
getNbParams()
Get the number of parameters with different names.int
getNbValuesToEstimate()
Get the number of values to estimate for parameters with different names.void
sort()
Sort the parameters lexicographically.
-
-
-
Method Detail
-
add
public void add(ParameterDriver driver)
Add a driver.If the driver is already present, it will not be added. If another driver managing the same parameter is present, both drivers will be managed together, existing drivers being set to the value of the last driver added (i.e. each addition overrides the parameter value).
Warning if a driver is added and a driver with the same name was already added before, they should have the same validity Period to avoid surprises. Whatever, all driver having same name will have their valueSpanMap, nameSpanMap and validity period overwritten with the last driver added attributes.
- Parameters:
driver
- driver to add
-
findByName
public ParameterDriversList.DelegatingDriver findByName(String name)
Find adelegating driver
by name.- Parameters:
name
- name to check- Returns:
- a
delegating driver
managing this parameter name - Since:
- 9.1
-
findDelegatingSpanNameBySpanName
public String findDelegatingSpanNameBySpanName(String name)
Find adelegating driver
by name.- Parameters:
name
- name to check- Returns:
- a
delegating driver
managing this parameter name - Since:
- 9.1
-
sort
public void sort()
Sort the parameters lexicographically.
-
filter
public void filter(boolean selected)
Filter parameters to keep only one type of selection status.- Parameters:
selected
- if true, onlyselected
parameters will be kept, the other ones will be removed
-
getNbParams
public int getNbParams()
Get the number of parameters with different names.- Returns:
- number of parameters with different names
-
getNbValuesToEstimate
public int getNbValuesToEstimate()
Get the number of values to estimate for parameters with different names.- Returns:
- number of values to estimate for parameters with different names
-
getDrivers
public List<ParameterDriversList.DelegatingDriver> getDrivers()
Get delegating drivers for all parameters.The delegating drivers are not the same as the drivers added to the list, but they delegate to them.
All delegating drivers manage parameters with different names.
- Returns:
- unmodifiable view of the list of delegating drivers
-
-