Class Effectives
- java.lang.Object
-
- org.ametys.plugins.odfpilotage.cost.entity.Effectives
-
public class Effectives extends Object
Class representingEffectives
-
-
Field Summary
Fields Modifier and Type Field Description private Double
_calculatedGlobalEffective
The calculated global effectiveprivate Map<String,Double>
_computedLocalEffectives
The calculated local effectivesprivate Optional<Double>
_enteredEffective
The entered effectiveprivate String
_programItemId
The program item id
-
Constructor Summary
Constructors Constructor Description Effectives(String programItemId)
The constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addComputedLocalEffective(String path, Double calculatedEffectiveLocal)
Set the calculated local effectiveboolean
containsComputedLocalEffective(String path)
Check if a local effective has been computed for the given pathDouble
getComputedGlobalEffective()
Get the calculated global effectiveDouble
getComputedLocalEffective(String path)
Get the computed local effective for a given pathOptional<Double>
getEnteredEffective()
Get the entered effectiveString
getProgramItemId()
Get the program item idvoid
globalhWeight(double globalWeight)
Apply a weight to all effectives by stepvoid
localWeight(double localWeight, String path)
Apply a weight on the local effectivevoid
setComputedGlobalEffective(Double calculatedGlobalEffective)
Set the calculated global effectivevoid
setEnteredEffective(Optional<Double> enteredEffective)
Set the entered effectivevoid
sum(Effectives effectives, String childPath, String parentPath)
Sum two Effectivesvoid
sumGlobalEffective(double globalEffective)
Sum the global effectivesvoid
sumLocalEffective(Effectives effectives, String childPath, String parentPath)
Sum two local effectives
-
-
-
Field Detail
-
_enteredEffective
private Optional<Double> _enteredEffective
The entered effective
-
_calculatedGlobalEffective
private Double _calculatedGlobalEffective
The calculated global effective
-
_computedLocalEffectives
private Map<String,Double> _computedLocalEffectives
The calculated local effectives
-
_programItemId
private String _programItemId
The program item id
-
-
Constructor Detail
-
Effectives
public Effectives(String programItemId)
The constructor- Parameters:
programItemId
- the program item id
-
-
Method Detail
-
getEnteredEffective
public Optional<Double> getEnteredEffective()
Get the entered effective- Returns:
- the entered effective
-
setEnteredEffective
public void setEnteredEffective(Optional<Double> enteredEffective)
Set the entered effective- Parameters:
enteredEffective
- the entered effective
-
getComputedLocalEffective
public Double getComputedLocalEffective(String path)
Get the computed local effective for a given path- Parameters:
path
- the current path- Returns:
- the calculated local effective
-
containsComputedLocalEffective
public boolean containsComputedLocalEffective(String path)
Check if a local effective has been computed for the given path- Parameters:
path
- the path- Returns:
- true if the local effective is computed
-
addComputedLocalEffective
public void addComputedLocalEffective(String path, Double calculatedEffectiveLocal)
Set the calculated local effective- Parameters:
path
- the current pathcalculatedEffectiveLocal
- the calculated local effective
-
getComputedGlobalEffective
public Double getComputedGlobalEffective()
Get the calculated global effective- Returns:
- the calculated global effective
-
setComputedGlobalEffective
public void setComputedGlobalEffective(Double calculatedGlobalEffective)
Set the calculated global effective- Parameters:
calculatedGlobalEffective
- the calculated global effective
-
getProgramItemId
public String getProgramItemId()
Get the program item id- Returns:
- the program item id
-
sum
public void sum(Effectives effectives, String childPath, String parentPath)
Sum two Effectives- Parameters:
effectives
- the second effective to sumchildPath
- the path of the old local effective valueparentPath
- the path of the new local effective value
-
sumLocalEffective
public void sumLocalEffective(Effectives effectives, String childPath, String parentPath)
Sum two local effectives- Parameters:
effectives
- the second effective to sumchildPath
- the path of the old local effective valueparentPath
- the path old the new local effective value
-
sumGlobalEffective
public void sumGlobalEffective(double globalEffective)
Sum the global effectives- Parameters:
globalEffective
- the global effective
-
localWeight
public void localWeight(double localWeight, String path)
Apply a weight on the local effective- Parameters:
localWeight
- the weightpath
- the path of the new local effective
-
globalhWeight
public void globalhWeight(double globalWeight)
Apply a weight to all effectives by step- Parameters:
globalWeight
- the weight
-
-