Class VolumesOfHours
java.lang.Object
org.ametys.plugins.odfpilotage.cost.entity.VolumesOfHours
Class representing a number of hours for each nature and can contain an original value for overridden course parts.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addOverriddenVolume
(String natureId, Double value) Add an overridden volume of hours for the given nature and store the old value into the original volume of hoursvoid
Add an volume of hours for the given natureGet the original volume of hours for this item (should be a course part only)getTotal()
Get the total volume of hours of all naturesGet the volume of hours for the given natureGet the volume of hours by naturevoid
sum
(VolumesOfHours volumesOfHours, Double weight) Sum the volume of hours with its weight on the current object
-
Constructor Details
-
VolumesOfHours
public VolumesOfHours()The constructor
-
-
Method Details
-
getVolumes
Get the volume of hours by nature- Returns:
- a
Map
the volumes of hours by nature
-
getVolume
Get the volume of hours for the given nature- Parameters:
natureId
- the nature identifier- Returns:
- the volume of hours for the given nature,
null
if not defined
-
addVolume
Add an volume of hours for the given nature- Parameters:
natureId
- the nature of the volumevalue
- the number of hours
-
addOverriddenVolume
Add an overridden volume of hours for the given nature and store the old value into the original volume of hours- Parameters:
natureId
- the nature of the volumevalue
- the number of hours
-
getOriginalVolumeOfHours
Get the original volume of hours for this item (should be a course part only)- Returns:
- the original value if it has been overridden, otherwise
null
-
sum
Sum the volume of hours with its weight on the current object- Parameters:
volumesOfHours
- The volumes to sum with the original objectweight
- the weight
-
getTotal
Get the total volume of hours of all natures- Returns:
- the total volume of hours
-