ItEr31S12ValidacionEProbasFuncionaisItEr30S17: Moving and making public method so it can be reused.

This commit is contained in:
Óscar González Fernández 2009-10-19 23:49:33 +02:00
parent 12aba8e4f5
commit 1cf2283f42
2 changed files with 10 additions and 10 deletions

View file

@ -61,4 +61,13 @@ public class ResourceAllocationWithDesiredResourcesPerDay {
public ResourcesPerDay getResourcesPerDay() {
return resourcesPerDay;
}
public static List<ResourceAllocation<?>> stripResourcesPerDay(
List<ResourceAllocationWithDesiredResourcesPerDay> withResourcesPerDay) {
List<ResourceAllocation<?>> result = new ArrayList<ResourceAllocation<?>>();
for (ResourceAllocationWithDesiredResourcesPerDay r : withResourcesPerDay) {
result.add(r.getResourceAllocation());
}
return result;
}
}

View file

@ -202,7 +202,7 @@ public class ResourceAllocationsBeingEdited {
}
return new AllocationResult(task, calculatedValue,
new AggregateOfResourceAllocations(
stripResourcesPerDay(allocations)), daysDuration,
ResourceAllocationWithDesiredResourcesPerDay.stripResourcesPerDay(allocations)), daysDuration,
fromDetachedToAttached);
}
@ -241,15 +241,6 @@ public class ResourceAllocationsBeingEdited {
return Days.daysBetween(start, end).getDays();
}
private List<ResourceAllocation<?>> stripResourcesPerDay(
List<ResourceAllocationWithDesiredResourcesPerDay> withResourcesPerDay) {
List<ResourceAllocation<?>> result = new ArrayList<ResourceAllocation<?>>();
for (ResourceAllocationWithDesiredResourcesPerDay r : withResourcesPerDay) {
result.add(r.getResourceAllocation());
}
return result;
}
private ResourceAllocation<?> createAllocation(AllocationDTO allocation) {
if (allocation instanceof SpecificAllocationDTO) {
SpecificAllocationDTO specific = (SpecificAllocationDTO) allocation;