Class VolumesOfHours

java.lang.Object
org.ametys.plugins.odfpilotage.cost.entity.VolumesOfHours

public class VolumesOfHours extends Object
Class representing a number of hours for each nature and can contain an original value for overridden course parts.
  • Constructor Details

  • Method Details

    • getVolumes

      Get the volume of hours by nature
      Returns:
      a Map the volumes of hours by nature
    • getVolume

      public Double getVolume(String natureId)
      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

      public void addVolume(String natureId, Double value)
      Add an volume of hours for the given nature
      Parameters:
      natureId - the nature of the volume
      value - the number of hours
    • addOverriddenVolume

      public void 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 hours
      Parameters:
      natureId - the nature of the volume
      value - 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

      public void sum(VolumesOfHours volumesOfHours, Double weight)
      Sum the volume of hours with its weight on the current object
      Parameters:
      volumesOfHours - The volumes to sum with the original object
      weight - the weight
    • getTotal

      public Double getTotal()
      Get the total volume of hours of all natures
      Returns:
      the total volume of hours