ItEr29S06CUAsignacionGrupoRecursosAPlanificacionItEr28S06: Adding method to calculate hours between two dates for an aggregate of ResourceAllocation
This commit is contained in:
parent
edb9d0c3d3
commit
ae6fc2ba19
1 changed files with 9 additions and 0 deletions
|
|
@ -29,6 +29,7 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.joda.time.LocalDate;
|
||||
|
||||
/**
|
||||
* Computes aggregate values on a set{@link ResourceAllocation}
|
||||
|
|
@ -72,4 +73,12 @@ public class AggregateOfResourceAllocations {
|
|||
return ResourceAllocation.sortedByStartDate(result);
|
||||
}
|
||||
|
||||
public int hoursBetween(LocalDate startDate, LocalDate endDate) {
|
||||
int sum = 0;
|
||||
for (ResourceAllocation<?> r : resourceAllocations) {
|
||||
sum += r.getAssignedHours(startDate, endDate);
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue