Class ParameterDriversList
parameter 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 drivers d1, d2...
dn are added to the list and both correspond to parameter
name "P", then getDrivers() will return a list containing
a delegating driver delegateD for the same name "P".
Afterwards, whenever either ParameterDriver.setValue(double)
or ParameterDriver.setReferenceDate(AbsoluteDate) is called
on any of the n+1 instances d1, d2... dn
or delegateD, the call will be automatically forwarded to the
n remaining instances, hence ensuring they remain consistent
with each other.
- Since:
- 8.0
- Author:
- Luc Maisonobe, Mélina Vanel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSpecialized driver delegating to several other managing the same parameter name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ParameterDriver driver) Add a driver.voidfilter(boolean selected) Filter parameters to keep only one type of selection status.findByName(String name) Find adelegating driverby name.Find adelegating driverby name.Get delegating drivers for all parameters.intGet the number of parameters with different names.intGet the number of values to estimate for parameters with different names.voidsort()Sort the parameters lexicographically.
-
Constructor Details
-
ParameterDriversList
public ParameterDriversList()Creates an empty list.
-
-
Method Details
-
add
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 periods 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
Find adelegating driverby name.- Parameters:
name- name to check- Returns:
- a
delegating drivermanaging this parameter name - Since:
- 9.1
-
findDelegatingSpanNameBySpanName
Find adelegating driverby name.- Parameters:
name- name to check- Returns:
- a
delegating drivermanaging 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, onlyselectedparameters 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
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
-