Class CostComputationDataCache
- java.lang.Object
-
- org.ametys.plugins.odfpilotage.cost.entity.CostComputationDataCache
-
public class CostComputationDataCache extends Object
This class store caches of the CostComputationDataComponent
-
-
Field Summary
Fields Modifier and Type Field Description private Map<String,Effectives>
_calculatedEffectiveCache
protected Container
_currentStep
The current stepprivate Map<String,Map<String,Long>>
_effectiveMinMaxByNature
private Map<String,Double>
_enteredEffectiveCache
private Map<String,Double>
_eqTDByNature
Map initialiséesprivate Map<String,Map<String,NormDetails>>
_norms
private OverriddenData
_overriddenData
private Map<String,Double>
_weightCache
-
Constructor Summary
Constructors Constructor Description CostComputationDataCache(List<OdfReferenceTableEntry> norms, List<OdfReferenceTableEntry> teachingNatures, OverriddenData overriddenData)
The constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_initializeNatureData(List<OdfReferenceTableEntry> teachingNatures)
Retrieve teaching nature values created and initialize informations about them in the cacheprotected void
_initializeNormData(List<OdfReferenceTableEntry> norms)
Retrieve norm values created and initialize informations about them in the cacheEffectives
getComputedEffectiveCache(String programItemId)
Get a calculated effective from a program item idContainer
getCurrentStep()
Get the current stepMap<String,Long>
getEffectiveMinMaxByNature(String natureId)
Get an effectiveMinMax from a nature idDouble
getEnteredEffectiveCache(String programItemId)
Get an enteredEffective from a program item idDouble
getEqTDByNature(String natureId)
Get an eqTD value from a natureIdNormDetails
getNorms(String normId, String natureId)
Get the norm retrieved by a nature idOptional<Double>
getOverriddenEffective(String programItemId)
Get the overridden effective of a program itemOptional<Double>
getOverriddenGroups(String programItemId)
Get the overridden number groups of a program itemOptional<Double>
getOverriddenVolumeOfHours(String programItemId, String natureId)
Get the overridden volume of hours of a program itemDouble
getWeight(String programItemPath)
Get a calculated effective from a program itemboolean
normsContainsNatureIdKey(String normId, String natureId)
Check if the norms map contains the nature idboolean
normsContainsNormIdKey(String normId)
Check if the norms map contains the norm idvoid
putComputedEffectiveCache(String programItemId, Effectives calculatedEffective)
Put a calculated effective in the mapvoid
putEffectiveMinMaxByNature(String natureId, Map<String,Long> effectiveMinMax)
Put an effectiveMinMax in the mapvoid
putEnteredEffectiveCache(String programItemId, Double enteredEffective)
Put an entered effective in the mapvoid
putEqTDByNature(String natureId, Double eqTD)
Put an eqTD value in the mapvoid
putNorms(String normId, Map<String,NormDetails> normValue)
Put a norm value in the mapvoid
putWeight(String programItemPath, Double weight)
Put a weight in the mapvoid
setCurrentStep(Container currentStep)
Set the current step
-
-
-
Field Detail
-
_currentStep
protected Container _currentStep
The current step
-
_eqTDByNature
private Map<String,Double> _eqTDByNature
Map initialisées
-
_enteredEffectiveCache
private Map<String,Double> _enteredEffectiveCache
-
_calculatedEffectiveCache
private Map<String,Effectives> _calculatedEffectiveCache
-
_weightCache
private Map<String,Double> _weightCache
-
_overriddenData
private OverriddenData _overriddenData
-
-
Constructor Detail
-
CostComputationDataCache
public CostComputationDataCache(List<OdfReferenceTableEntry> norms, List<OdfReferenceTableEntry> teachingNatures, OverriddenData overriddenData)
The constructor- Parameters:
norms
- list of normsteachingNatures
- list of teaching naturesoverriddenData
- overridden data by the user
-
-
Method Detail
-
_initializeNormData
protected void _initializeNormData(List<OdfReferenceTableEntry> norms)
Retrieve norm values created and initialize informations about them in the cache- Parameters:
norms
- list of norms
-
_initializeNatureData
protected void _initializeNatureData(List<OdfReferenceTableEntry> teachingNatures)
Retrieve teaching nature values created and initialize informations about them in the cache- Parameters:
teachingNatures
- list of teaching natures
-
getEqTDByNature
public Double getEqTDByNature(String natureId)
Get an eqTD value from a natureId- Parameters:
natureId
- the nature id- Returns:
- the eqTD value
-
putEqTDByNature
public void putEqTDByNature(String natureId, Double eqTD)
Put an eqTD value in the map- Parameters:
natureId
- the nature ideqTD
- the eqTD value
-
getEffectiveMinMaxByNature
public Map<String,Long> getEffectiveMinMaxByNature(String natureId)
Get an effectiveMinMax from a nature id- Parameters:
natureId
- the nature id- Returns:
- the effective min max
-
putEffectiveMinMaxByNature
public void putEffectiveMinMaxByNature(String natureId, Map<String,Long> effectiveMinMax)
Put an effectiveMinMax in the map- Parameters:
natureId
- the nature ideffectiveMinMax
- the effective min max
-
getNorms
public NormDetails getNorms(String normId, String natureId)
Get the norm retrieved by a nature id- Parameters:
normId
- the norm idnatureId
- the nature id- Returns:
- the norm
-
normsContainsNormIdKey
public boolean normsContainsNormIdKey(String normId)
Check if the norms map contains the norm id- Parameters:
normId
- the norm id- Returns:
- true if the norms map contains the norm id
-
normsContainsNatureIdKey
public boolean normsContainsNatureIdKey(String normId, String natureId)
Check if the norms map contains the nature id- Parameters:
normId
- the norm idnatureId
- the nature id- Returns:
- true if the norms map contains the nature id
-
putNorms
public void putNorms(String normId, Map<String,NormDetails> normValue)
Put a norm value in the map- Parameters:
normId
- the norm idnormValue
- the value
-
getEnteredEffectiveCache
public Double getEnteredEffectiveCache(String programItemId)
Get an enteredEffective from a program item id- Parameters:
programItemId
- the program item id- Returns:
- the entered effective
-
putEnteredEffectiveCache
public void putEnteredEffectiveCache(String programItemId, Double enteredEffective)
Put an entered effective in the map- Parameters:
programItemId
- the program item identeredEffective
- the entered effective
-
getComputedEffectiveCache
public Effectives getComputedEffectiveCache(String programItemId)
Get a calculated effective from a program item id- Parameters:
programItemId
- the program item id- Returns:
- the calculated effective
-
putComputedEffectiveCache
public void putComputedEffectiveCache(String programItemId, Effectives calculatedEffective)
Put a calculated effective in the map- Parameters:
programItemId
- the program item idcalculatedEffective
- the calculated effective
-
putWeight
public void putWeight(String programItemPath, Double weight)
Put a weight in the map- Parameters:
programItemPath
- the program item idweight
- the weight
-
getWeight
public Double getWeight(String programItemPath)
Get a calculated effective from a program item- Parameters:
programItemPath
- the path of the program item- Returns:
- the calculated effective
-
setCurrentStep
public void setCurrentStep(Container currentStep)
Set the current step- Parameters:
currentStep
- the current step
-
getCurrentStep
public Container getCurrentStep()
Get the current step- Returns:
- the step
-
getOverriddenEffective
public Optional<Double> getOverriddenEffective(String programItemId)
Get the overridden effective of a program item- Parameters:
programItemId
- the program item id- Returns:
- the overridden effective
-
getOverriddenGroups
public Optional<Double> getOverriddenGroups(String programItemId)
Get the overridden number groups of a program item- Parameters:
programItemId
- the program item id- Returns:
- the overridden number of groups
-
getOverriddenVolumeOfHours
public Optional<Double> getOverriddenVolumeOfHours(String programItemId, String natureId)
Get the overridden volume of hours of a program item- Parameters:
programItemId
- the program item idnatureId
- the nature of the volume of hours- Returns:
- the overridden volume of hours
-
-