Class CostComputationDataCache
- java.lang.Object
-
- org.ametys.plugins.odfpilotage.cost.entity.CostComputationDataCache
-
public class CostComputationDataCache extends Object
This class store caches of the CostComputationDataComponent
-
-
Constructor Summary
Constructors Constructor Description CostComputationDataCache(List<Program> programs, List<OdfReferenceTableEntry> norms, List<OdfReferenceTableEntry> teachingNatures, String yearNature, 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 cacheboolean
addExploredItem(String exploredItem)
Add the item to the list of explored itemsCostComputationData
getCostComputationData()
Get the computation data, useful at the end of the computation to return the final results.NormDetails
getEffectiveMinMaxByNature(String natureId)
Get an effectiveMinMax for a nature idEffectives
getEffectives(String programItemId)
Get a computed effective for a program item idEqTD
getEqTD(String programItemId)
Get the td equivalent for a program item idDouble
getEqTDByNature(String natureId)
Get an eqTD value for a natureIdString
getEqTDComputationByNature(String natureId)
Get an eqTD computation mode for a natureIdGroups
getGroups(String programItemId)
Get the groups for a program item idNormDetails
getNormDetails(String programItemId)
Get the norm details for a program item idNormDetails
getNormDetailsForNature(String normId, String natureId)
Get the norm retrieved by a nature idLong
getOverriddenEffective(String programItemId)
Get the overridden effective of a program itemLong
getOverriddenGroups(String programItemId)
Get the overridden number groups of a program itemDouble
getOverriddenVolumeOfHours(String programItemId)
Get the overridden volume of hours of a program itemProgramItemData
getProgramItemData(String programItemId)
Get the full program item (or course part, or orgunit) computed dataVolumesOfHours
getVolumesOfHours(String programItemId)
Get the volumes of hours for a program item idDouble
getWeight(String programItemId)
Get a weight for a program itemString
getYearNature()
Get the identifier of the year nature.boolean
natureInNormExists(String normId, String natureId)
Check if the norms map contains the nature idboolean
normExists(String normId)
Check if the norms map contains the norm idvoid
putEffectives(String programItemId, Effectives effectives)
Put a computed effective in the mapvoid
putEqTD(String programItemId, EqTD eqTD)
Put td equivalent in the cache for a program item (or course part)void
putGroups(String programItemId, Groups groups)
Put groups in the cache for a program item (or course part)void
putNormDetails(String programItemId, NormDetails normDetails)
Put norm details in the cache for a program item (or course part)void
putVolumesOfHours(String programItemId, VolumesOfHours volumesOfHours)
Put volumes of hours in the cache for a program item (or course part)void
putWeight(String programItemId, Double weight)
Put a weight in the cache for a program item (or course part)
-
-
-
Constructor Detail
-
CostComputationDataCache
public CostComputationDataCache(List<Program> programs, List<OdfReferenceTableEntry> norms, List<OdfReferenceTableEntry> teachingNatures, String yearNature, OverriddenData overriddenData)
The constructor- Parameters:
programs
- the programs concerned by the current cost computationnorms
- list of normsteachingNatures
- list of teaching naturesyearNature
- identifier for the container's nature with year ("annee") valueoverriddenData
- 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
-
addExploredItem
public boolean addExploredItem(String exploredItem)
Add the item to the list of explored items- Parameters:
exploredItem
- the item to explore- Returns:
false
if the item has already been added
-
getCostComputationData
public CostComputationData getCostComputationData()
Get the computation data, useful at the end of the computation to return the final results.- Returns:
- A
CostComputationData
object with volumes, eqTD, groups, effectives, etc.
-
getEqTDComputationByNature
public String getEqTDComputationByNature(String natureId)
Get an eqTD computation mode for a natureId- Parameters:
natureId
- the nature id- Returns:
- the eqTD computation mode
-
getEqTDByNature
public Double getEqTDByNature(String natureId)
Get an eqTD value for a natureId- Parameters:
natureId
- the nature id- Returns:
- the eqTD value
-
getEffectiveMinMaxByNature
public NormDetails getEffectiveMinMaxByNature(String natureId)
Get an effectiveMinMax for a nature id- Parameters:
natureId
- the nature id- Returns:
- the effective min max
-
getNormDetailsForNature
public NormDetails getNormDetailsForNature(String normId, String natureId)
Get the norm retrieved by a nature id- Parameters:
normId
- the norm idnatureId
- the nature id- Returns:
- the norm
-
normExists
public boolean normExists(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
-
natureInNormExists
public boolean natureInNormExists(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
-
getYearNature
public String getYearNature()
Get the identifier of the year nature.- Returns:
- the identifier of the year ("annee") container's nature, can be null
-
getProgramItemData
public ProgramItemData getProgramItemData(String programItemId)
Get the full program item (or course part, or orgunit) computed data- Parameters:
programItemId
- the identifier of the object- Returns:
- a
ProgramItemData
containing all useful informations for a given program item (or course part, or orgunit)
-
getEffectives
public Effectives getEffectives(String programItemId)
Get a computed effective for a program item id- Parameters:
programItemId
- the program item (or course part) identifier- Returns:
- the computed effective
-
putEffectives
public void putEffectives(String programItemId, Effectives effectives)
Put a computed effective in the map- Parameters:
programItemId
- the program item (or course part) identifiereffectives
- the effectives
-
getWeight
public Double getWeight(String programItemId)
Get a weight for a program item- Parameters:
programItemId
- the program item id- Returns:
- the weight
-
putWeight
public void putWeight(String programItemId, Double weight)
Put a weight in the cache for a program item (or course part)- Parameters:
programItemId
- the program item (or course part) identifierweight
- the weight
-
getVolumesOfHours
public VolumesOfHours getVolumesOfHours(String programItemId)
Get the volumes of hours for a program item id- Parameters:
programItemId
- the program item (or course part) identifier- Returns:
- the volumes of hours
-
putVolumesOfHours
public void putVolumesOfHours(String programItemId, VolumesOfHours volumesOfHours)
Put volumes of hours in the cache for a program item (or course part)- Parameters:
programItemId
- the program item (or course part) identifiervolumesOfHours
- the volumes of hours
-
getGroups
public Groups getGroups(String programItemId)
Get the groups for a program item id- Parameters:
programItemId
- the program item (or course part) identifier- Returns:
- the groups
-
putGroups
public void putGroups(String programItemId, Groups groups)
Put groups in the cache for a program item (or course part)- Parameters:
programItemId
- the program item (or course part) identifiergroups
- the groups
-
getEqTD
public EqTD getEqTD(String programItemId)
Get the td equivalent for a program item id- Parameters:
programItemId
- the program item (or course part) identifier- Returns:
- the td equivalent
-
putEqTD
public void putEqTD(String programItemId, EqTD eqTD)
Put td equivalent in the cache for a program item (or course part)- Parameters:
programItemId
- the program item (or course part) identifiereqTD
- the td equivalent
-
getNormDetails
public NormDetails getNormDetails(String programItemId)
Get the norm details for a program item id- Parameters:
programItemId
- the program item (or course part) identifier- Returns:
- the norm details
-
putNormDetails
public void putNormDetails(String programItemId, NormDetails normDetails)
Put norm details in the cache for a program item (or course part)- Parameters:
programItemId
- the program item (or course part) identifiernormDetails
- the norm details
-
getOverriddenEffective
public Long getOverriddenEffective(String programItemId)
Get the overridden effective of a program item- Parameters:
programItemId
- the program item id- Returns:
- the overridden effective
-
getOverriddenGroups
public Long 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 Double getOverriddenVolumeOfHours(String programItemId)
Get the overridden volume of hours of a program item- Parameters:
programItemId
- the program item id- Returns:
- the overridden volume of hours
-
-